@anionzo/skill 1.1.0 → 1.3.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
@@ -127,19 +127,16 @@ bash scripts/sync-platform-files
127
127
  > Available on [npm](https://www.npmjs.com/package/@anionzo/skill) — no authentication required
128
128
 
129
129
  ```bash
130
- # 1. Install the package
131
130
  npm install @anionzo/skill
131
+ ```
132
132
 
133
- # 2. Copy skills/knowledge to your project
134
- cp -r node_modules/@anionzo/skill/skills/ ./
135
- cp -r node_modules/@anionzo/skill/knowledge/ ./
133
+ That's it! Skills are automatically installed into:
136
134
 
137
- # 3. Generate platform files
138
- bash node_modules/@anionzo/skill/scripts/sync-platform-files
135
+ - `.opencode/skills/` for OpenCode
136
+ - `.claude/skills/` — for Claude Code
137
+ - `.agents/skills/` — for other agents
139
138
 
140
- # 4. Copy the output to your agent
141
- cp generated/CLAUDE.md ./ # or OPENCODE.md, GEMINI.md, etc.
142
- ```
139
+ Open your agent and use `/skill` to see available skills.
143
140
 
144
141
  > 💡 Or clone the repo directly if you prefer editing skills in place.
145
142
 
package/i18n/README.vi.md CHANGED
@@ -125,19 +125,16 @@ bash scripts/sync-platform-files
125
125
  > Có sẵn trên [npm](https://www.npmjs.com/package/@anionzo/skill) — không cần xác thực
126
126
 
127
127
  ```bash
128
- # 1. Cài đặt package
129
128
  npm install @anionzo/skill
129
+ ```
130
130
 
131
- # 2. Copy skills/knowledge vào project
132
- cp -r node_modules/@anionzo/skill/skills/ ./
133
- cp -r node_modules/@anionzo/skill/knowledge/ ./
131
+ Xong! Skill tự động được cài vào:
134
132
 
135
- # 3. Sinh platform file
136
- bash node_modules/@anionzo/skill/scripts/sync-platform-files
133
+ - `.opencode/skills/` cho OpenCode
134
+ - `.claude/skills/` — cho Claude Code
135
+ - `.agents/skills/` — cho các agent khác
137
136
 
138
- # 4. Copy output sang agent
139
- cp generated/CLAUDE.md ./ # hoặc OPENCODE.md, GEMINI.md, v.v.
140
- ```
137
+ Mở agent dùng `/skill` để xem danh sách skill.
141
138
 
142
139
  > 💡 Hoặc clone repo trực tiếp nếu muốn chỉnh sửa skill tại chỗ.
143
140
 
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@anionzo/skill",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Personal AI Skill Library — vendor-neutral, multi-agent skill library for AI-powered software engineering",
5
+ "bin": {
6
+ "anionzo-skill": "scripts/install-opencode-skills"
7
+ },
5
8
  "scripts": {
6
9
  "validate": "bash scripts/validate-skills",
7
10
  "sync": "bash scripts/sync-platform-files",
8
- "postinstall": "echo \"\\n🧠 @anionzo/skill installed successfully!\\n\\n📁 Skills: node_modules/@anionzo/skill/skills/\\n📚 Knowledge: node_modules/@anionzo/skill/knowledge/\\n📄 Docs: node_modules/@anionzo/skill/docs/\\n🌐 i18n: node_modules/@anionzo/skill/i18n/\\n\\n🔌 To use: copy generated/ output to your project\\n bash node_modules/@anionzo/skill/scripts/sync-platform-files\\n\""
11
+ "install-opencode": "bash scripts/install-opencode-skills",
12
+ "postinstall": "bash scripts/install-opencode-skills"
9
13
  },
10
14
  "files": [
11
15
  "skills/",
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # Install skills into .opencode/skills/ with proper YAML frontmatter
4
+ #
5
+ # Auto-runs on npm install (postinstall hook).
6
+ # Also supports: .claude/skills/ and .agents/skills/
7
+ #
8
+ # Manual usage:
9
+ # bash scripts/install-opencode-skills [project-dir]
10
+
11
+ set -eu
12
+
13
+ SCRIPT_PATH=$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")
14
+ ROOT=$(CDPATH= cd -- "$(dirname "$SCRIPT_PATH")/.." && pwd)
15
+
16
+ # Determine project root: explicit arg > INIT_CWD (set by npm) > current dir
17
+ if [ -n "${1:-}" ]; then
18
+ PROJECT="$1"
19
+ elif [ -n "${INIT_CWD:-}" ]; then
20
+ PROJECT="$INIT_CWD"
21
+ else
22
+ PROJECT="$(pwd)"
23
+ fi
24
+
25
+ # Don't install into ourselves
26
+ case "$PROJECT" in
27
+ */node_modules/*) exit 0 ;;
28
+ esac
29
+
30
+ install_skills() {
31
+ target_dir="$1"
32
+ format_name="$2"
33
+
34
+ mkdir -p "$target_dir"
35
+ count=0
36
+
37
+ for skill_dir in "$ROOT"/skills/*/; do
38
+ [ -d "$skill_dir" ] || continue
39
+
40
+ skill_name=$(basename "$skill_dir")
41
+ skill_md="$skill_dir/SKILL.md"
42
+ meta_yaml="$skill_dir/meta.yaml"
43
+
44
+ [ -f "$skill_md" ] || continue
45
+ [ -f "$meta_yaml" ] || continue
46
+
47
+ summary=$(sed -n 's/^summary:[[:space:]]*//p' "$meta_yaml" | sed -n '1p')
48
+
49
+ mkdir -p "$target_dir/$skill_name"
50
+
51
+ {
52
+ printf '%s\n' '---'
53
+ printf 'name: %s\n' "$skill_name"
54
+ printf 'description: "%s"\n' "$summary"
55
+ printf 'license: MIT\n'
56
+ printf '%s\n' '---'
57
+ cat "$skill_md"
58
+ } > "$target_dir/$skill_name/SKILL.md"
59
+
60
+ count=$((count + 1))
61
+ done
62
+
63
+ printf ' %s: %d skills -> %s\n' "$format_name" "$count" "$target_dir"
64
+ }
65
+
66
+ printf '\n@anionzo/skill: installing skills...\n'
67
+
68
+ # OpenCode: .opencode/skills/
69
+ install_skills "$PROJECT/.opencode/skills" "OpenCode"
70
+
71
+ # Claude Code: .claude/skills/
72
+ install_skills "$PROJECT/.claude/skills" "Claude"
73
+
74
+ # Generic agents: .agents/skills/
75
+ install_skills "$PROJECT/.agents/skills" "Agents"
76
+
77
+ printf '\nDone! Skills are ready. Use /skill in OpenCode or Claude Code.\n\n'