k8s-agent-skills 1.3.0 → 1.5.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.
package/README.md CHANGED
@@ -66,9 +66,14 @@ npm install --save-dev k8s-agent-skills
66
66
  # or
67
67
  bun add -d k8s-agent-skills
68
68
 
69
- # Symlink skills to agent config dir
70
- npx skills-npm
71
- # → symlinks skills/ into ~/.agents/skills/
69
+ # Symlink all skills to ~/.agents/skills/ (OpenCode)
70
+ npx skills-link
71
+
72
+ # Or to other agent directories:
73
+ npx skills-link --claude # Claude Code (~/.claude/skills/)
74
+ npx skills-link --codex # Codex CLI (~/.codex/skills/)
75
+ npx skills-link --cursor # Cursor (~/.cursor/skills/)
76
+ npx skills-link --all # all known agent dirs
72
77
  ```
73
78
 
74
79
  ### Via git clone
@@ -90,12 +95,18 @@ cp -r skills/external-dns ~/.claude/skills/
90
95
 
91
96
  ## npm Publishing
92
97
 
93
- The package auto-publishes to npm on push to `main` via GitHub Actions.
98
+ Auto-publishes on `v*` tag push via GitHub Actions with OIDC Trusted Publisher — no tokens needed.
94
99
 
95
- **Setup required** (one-time):
96
- 1. Create an npm automation token at [npmjs.com/settings/tokens](https://www.npmjs.com/settings/tokens)
97
- 2. Add it as `NPM_TOKEN` secret in the GitHub repo settings
98
- 3. Workflow at `.github/workflows/publish.yml` handles version bump and publish
100
+ ```bash
101
+ # Bump version
102
+ npm version patch # or minor / major
103
+
104
+ # Tag and push
105
+ git push origin main --tags
106
+ git push github main --tags
107
+ ```
108
+
109
+ Or manually: `git tag vX.Y.Z && git push origin main --tags && git push github main --tags`.
99
110
 
100
111
  ## License
101
112
 
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # skills-link — Symlink k8s-agent-skills to agent skill directories
5
+ # Usage:
6
+ # skills-link # link to ~/.agents/skills/ (OpenCode)
7
+ # skills-link --claude # link to ~/.claude/skills/ (Claude Code)
8
+ # skills-link --codex # link to ~/.codex/skills/ (Codex CLI)
9
+ # skills-link --cursor # link to ~/.cursor/skills/ (Cursor)
10
+ # skills-link --all # link to all known agent dirs
11
+ #
12
+ # Cleans up broken symlinks (removed skills) before linking.
13
+
14
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
15
+ # Package root is parent of bin/
16
+ PKG_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ SKILLS_DIR="$PKG_DIR/skills"
18
+
19
+ if [ ! -d "$SKILLS_DIR" ]; then
20
+ echo "ERROR: skills/ not found at $SKILLS_DIR" >&2
21
+ echo "Run this script from within the k8s-agent-skills package." >&2
22
+ exit 1
23
+ fi
24
+
25
+ declare -a TARGETS
26
+
27
+ # Default target
28
+ TARGETS+=("$HOME/.agents/skills")
29
+
30
+ while [[ $# -gt 0 ]]; do
31
+ case "$1" in
32
+ --claude) TARGETS+=("$HOME/.claude/skills") ;;
33
+ --codex) TARGETS+=("$HOME/.codex/skills") ;;
34
+ --cursor) TARGETS+=("$HOME/.cursor/skills") ;;
35
+ --agents) TARGETS+=("$HOME/.agents/skills") ;;
36
+ --all)
37
+ TARGETS+=("$HOME/.agents/skills")
38
+ TARGETS+=("$HOME/.claude/skills")
39
+ TARGETS+=("$HOME/.codex/skills")
40
+ TARGETS+=("$HOME/.cursor/skills")
41
+ ;;
42
+ --help|-h)
43
+ echo "Usage: skills-link [--claude] [--codex] [--cursor] [--agents] [--all]"
44
+ echo "Default: ~/.agents/skills/ (OpenCode)"
45
+ exit 0
46
+ ;;
47
+ *)
48
+ echo "Unknown option: $1" >&2
49
+ echo "Usage: skills-link [--claude] [--codex] [--cursor] [--agents] [--all]" >&2
50
+ exit 1
51
+ ;;
52
+ esac
53
+ shift
54
+ done
55
+
56
+ # Deduplicate targets
57
+ declare -a UNIQUE
58
+ for t in "${TARGETS[@]}"; do
59
+ seen=false
60
+ for u in "${UNIQUE[@]}"; do
61
+ [ "$u" = "$t" ] && seen=true && break
62
+ done
63
+ $seen || UNIQUE+=("$t")
64
+ done
65
+
66
+ for TARGET in "${UNIQUE[@]}"; do
67
+ mkdir -p "$TARGET"
68
+
69
+ # Cleanup broken symlinks (skills removed from package)
70
+ broken=0
71
+ while IFS= read -r -d '' link; do
72
+ if [ ! -e "$link" ]; then
73
+ rm -f "$link"
74
+ broken=$((broken + 1))
75
+ fi
76
+ done < <(find "$TARGET" -maxdepth 1 -type l -name '*' -print0 2>/dev/null || true)
77
+
78
+ # Symlink each skill
79
+ linked=0
80
+ skipped=0
81
+ migrated=0
82
+ for skill_dir in "$SKILLS_DIR"/*/; do
83
+ [ -d "$skill_dir" ] || continue
84
+ skill_name="$(basename "$skill_dir")"
85
+ link_path="$TARGET/$skill_name"
86
+
87
+ # Check if symlink already points to the right place
88
+ if [ -L "$link_path" ] && [ "$(readlink "$link_path")" = "$skill_dir" ]; then
89
+ skipped=$((skipped + 1))
90
+ continue
91
+ fi
92
+
93
+ # Handle existing entry at link_path
94
+ if [ -e "$link_path" ] || [ -L "$link_path" ]; then
95
+ if [ -L "$link_path" ]; then
96
+ rm -f "$link_path"
97
+ elif [ -d "$link_path" ] && [ -f "$link_path/SKILL.md" ]; then
98
+ # Old-style skill directory (copied, not symlinked) — replace with symlink
99
+ rm -rf "$link_path"
100
+ migrated=$((migrated + 1))
101
+ else
102
+ echo " WARN: $link_path exists and is not a symlink — skipping" >&2
103
+ continue
104
+ fi
105
+ fi
106
+
107
+ ln -sf "$skill_dir" "$link_path"
108
+ linked=$((linked + 1))
109
+ done
110
+
111
+ echo "[$TARGET] linked $linked skill(s), $skipped up-to-date, $migrated migrated, $broken stale symlink(s) removed"
112
+ done
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "k8s-agent-skills",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "private": false,
5
5
  "description": "Agent skills for Kubernetes cluster operations — Cilium, Talos, Flux, Rook-Ceph, CNPG, Gitea, Tekton, Cert-Manager, VictoriaMetrics, ZITADEL, Harbor, Higress, KServe, Kubeflow, MariaDB, Vector, ExternalDNS, Dragonfly, Flagger, Sealed Secrets, Stakater Reloader, NVIDIA GPU, Atlas",
6
6
  "files": [
7
- "skills"
7
+ "skills",
8
+ "bin"
8
9
  ],
10
+ "bin": {
11
+ "skills-link": "./bin/skills-link"
12
+ },
9
13
  "keywords": [
10
14
  "ai-agent-skill",
11
15
  "kubernetes",