@anionzo/skill 1.3.0 → 1.6.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/CONTRIBUTING.md +2 -1
- package/README.md +29 -10
- package/docs/design-brief.md +19 -13
- package/i18n/CONTRIBUTING.vi.md +2 -1
- package/i18n/README.vi.md +29 -10
- package/i18n/design-brief.vi.md +19 -13
- package/knowledge/global/skill-triggering-rules.md +2 -1
- package/package.json +1 -1
- package/scripts/install-opencode-skills +161 -12
- package/skills/brainstorming/SKILL.md +176 -13
- package/skills/brainstorming/meta.yaml +19 -10
- package/skills/code-review/SKILL.md +214 -19
- package/skills/code-review/meta.yaml +21 -9
- package/skills/commit/SKILL.md +187 -0
- package/skills/commit/examples.md +62 -0
- package/skills/commit/meta.yaml +30 -0
- package/skills/commit/references/output-template.md +14 -0
- package/skills/debug/SKILL.md +252 -0
- package/skills/debug/examples.md +83 -0
- package/skills/debug/meta.yaml +38 -0
- package/skills/debug/references/output-template.md +16 -0
- package/skills/docs-writer/SKILL.md +85 -10
- package/skills/docs-writer/meta.yaml +16 -12
- package/skills/extract/SKILL.md +161 -0
- package/skills/extract/examples.md +47 -0
- package/skills/extract/meta.yaml +27 -0
- package/skills/extract/references/output-template.md +24 -0
- package/skills/feature-delivery/SKILL.md +10 -5
- package/skills/feature-delivery/meta.yaml +5 -0
- package/skills/go-pipeline/SKILL.md +156 -0
- package/skills/go-pipeline/examples.md +56 -0
- package/skills/go-pipeline/meta.yaml +27 -0
- package/skills/go-pipeline/references/output-template.md +17 -0
- package/skills/planning/SKILL.md +128 -17
- package/skills/planning/meta.yaml +15 -6
- package/skills/refactor-safe/SKILL.md +10 -7
- package/skills/repo-onboarding/SKILL.md +11 -7
- package/skills/repo-onboarding/meta.yaml +2 -0
- package/skills/research/SKILL.md +100 -0
- package/skills/research/examples.md +79 -0
- package/skills/research/meta.yaml +27 -0
- package/skills/research/references/output-template.md +23 -0
- package/skills/test-driven-development/SKILL.md +194 -0
- package/skills/test-driven-development/examples.md +77 -0
- package/skills/test-driven-development/meta.yaml +31 -0
- package/skills/test-driven-development/references/.gitkeep +0 -0
- package/skills/test-driven-development/references/output-template.md +31 -0
- package/skills/using-skills/SKILL.md +32 -14
- package/skills/using-skills/examples.md +3 -3
- package/skills/using-skills/meta.yaml +8 -3
- package/skills/verification-before-completion/SKILL.md +127 -13
- package/skills/verification-before-completion/meta.yaml +24 -14
- package/templates/SKILL.md +8 -1
- package/skills/bug-triage/SKILL.md +0 -47
- package/skills/bug-triage/examples.md +0 -68
- package/skills/bug-triage/meta.yaml +0 -25
- package/skills/bug-triage/references/output-template.md +0 -26
package/CONTRIBUTING.md
CHANGED
|
@@ -79,7 +79,7 @@ cp -r templates/ skills/<your-skill-name>/
|
|
|
79
79
|
|---|---|---|
|
|
80
80
|
| `name` | ✅ | Skill identifier (kebab-case) |
|
|
81
81
|
| `version` | ✅ | Semantic version (`1.0.0`) |
|
|
82
|
-
| `category` | ✅ | One of: `routing`, `discovery`, `planning`, `implementation`, `
|
|
82
|
+
| `category` | ✅ | One of: `routing`, `discovery`, `planning`, `implementation`, `troubleshooting`, `review`, `documentation`, `quality`, `knowledge`, `workflow` |
|
|
83
83
|
| `summary` | ✅ | One-line English description |
|
|
84
84
|
| `summary_vi` | 🟡 | One-line Vietnamese description |
|
|
85
85
|
| `triggers` | 🟡 | When to activate this skill |
|
|
@@ -161,6 +161,7 @@ Knowledge files live in `knowledge/global/`. They contain principles, heuristics
|
|
|
161
161
|
| 🔍 `review-heuristics.md` | Code review rules |
|
|
162
162
|
| 🐛 `debugging-patterns.md` | Systematic debugging approaches |
|
|
163
163
|
| 🧠 `skill-triggering-rules.md` | When to load which skill |
|
|
164
|
+
| 📋 `evidence-before-claims.md` | Evidence requirements before completion claims |
|
|
164
165
|
|
|
165
166
|
When adding or editing knowledge:
|
|
166
167
|
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**A vendor-neutral, multi-agent skill library for AI-powered software engineering**
|
|
6
6
|
|
|
7
|
-
[](skills/)
|
|
8
8
|
[](knowledge/)
|
|
9
9
|
[](adapters/)
|
|
10
10
|
[](LICENSE)
|
|
@@ -51,15 +51,20 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
51
51
|
| | Skill | Purpose |
|
|
52
52
|
|---|---|---|
|
|
53
53
|
| 🧭 | `using-skills` | Route a request to the right skill and working mode |
|
|
54
|
-
| 💡 | `brainstorming` |
|
|
54
|
+
| 💡 | `brainstorming` | Explore ideas, lock decisions, optionally write a spec |
|
|
55
55
|
| 🗺️ | `repo-onboarding` | Understand an unfamiliar codebase before acting |
|
|
56
|
-
|
|
|
56
|
+
| 🔎 | `research` | Explore existing code and patterns before implementing |
|
|
57
|
+
| 📐 | `planning` | Execution-ready plans with bite-sized steps and no placeholders |
|
|
57
58
|
| 🚀 | `feature-delivery` | Implement a feature with minimal, repo-aligned change |
|
|
58
|
-
|
|
|
59
|
+
| 🧪 | `test-driven-development` | Enforce test-first discipline with red-green-refactor |
|
|
60
|
+
| 🐛 | `debug` | 4-phase systematic debugging with root cause investigation |
|
|
59
61
|
| ♻️ | `refactor-safe` | Restructure code without changing behavior |
|
|
60
|
-
| ✅ | `verification-before-completion` |
|
|
61
|
-
| 🔍 | `code-review` |
|
|
62
|
-
| 📝 | `
|
|
62
|
+
| ✅ | `verification-before-completion` | Iron law: no completion claims without fresh evidence |
|
|
63
|
+
| 🔍 | `code-review` | Give and receive code reviews with severity triage |
|
|
64
|
+
| 📝 | `commit` | Create conventional commits with staged change review |
|
|
65
|
+
| 📖 | `docs-writer` | Update docs from verified source behavior |
|
|
66
|
+
| 🧬 | `extract` | Extract patterns, decisions, and learnings from work |
|
|
67
|
+
| ⚡ | `go-pipeline` | Execute a full spec-to-commit pipeline in one run |
|
|
63
68
|
|
|
64
69
|
### 🔄 Default Workflow
|
|
65
70
|
|
|
@@ -77,10 +82,13 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
77
82
|
┌────────────┼────────────┐
|
|
78
83
|
▼ ▼ ▼
|
|
79
84
|
┌────────────┐ ┌───────────┐ ┌──────────────┐
|
|
80
|
-
│ feature- │ │
|
|
85
|
+
│ feature- │ │ debug │ │ refactor-safe│
|
|
81
86
|
│ delivery │ │ │ │ │
|
|
82
87
|
└─────┬──────┘ └─────┬─────┘ └──────┬───────┘
|
|
83
88
|
│ │ │
|
|
89
|
+
│ ┌──────┴──────┐ │
|
|
90
|
+
│ │ TDD │ │
|
|
91
|
+
│ └──────┬──────┘ │
|
|
84
92
|
▼ ▼ ▼
|
|
85
93
|
┌─────────────────────────────────────────┐
|
|
86
94
|
│ verification-before-completion │
|
|
@@ -88,7 +96,11 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
88
96
|
▼
|
|
89
97
|
┌─────────────┐
|
|
90
98
|
│ code-review │
|
|
91
|
-
|
|
99
|
+
└──────┬──────┘
|
|
100
|
+
▼
|
|
101
|
+
┌──────────┐
|
|
102
|
+
│ commit │
|
|
103
|
+
└──────────┘
|
|
92
104
|
```
|
|
93
105
|
|
|
94
106
|
### 📖 Research Highlights
|
|
@@ -126,11 +138,18 @@ bash scripts/sync-platform-files
|
|
|
126
138
|
|
|
127
139
|
> Available on [npm](https://www.npmjs.com/package/@anionzo/skill) — no authentication required
|
|
128
140
|
|
|
141
|
+
```bash
|
|
142
|
+
# Recommended: one command, no package.json created
|
|
143
|
+
npx @anionzo/skill
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Or add as a project dependency (creates package.json):
|
|
147
|
+
|
|
129
148
|
```bash
|
|
130
149
|
npm install @anionzo/skill
|
|
131
150
|
```
|
|
132
151
|
|
|
133
|
-
|
|
152
|
+
Skills are automatically installed into:
|
|
134
153
|
|
|
135
154
|
- `.opencode/skills/` — for OpenCode
|
|
136
155
|
- `.claude/skills/` — for Claude Code
|
package/docs/design-brief.md
CHANGED
|
@@ -73,19 +73,25 @@ A personal operating library with three layers:
|
|
|
73
73
|
5. ⚙️ The first version uses simple shell scripts instead of introducing a build system
|
|
74
74
|
6. ✅ Planning and verification are explicit phases for code-changing work
|
|
75
75
|
|
|
76
|
-
### 🎯
|
|
77
|
-
|
|
78
|
-
The
|
|
79
|
-
|
|
80
|
-
- 🧭 Routing requests
|
|
81
|
-
- 💡 Refining
|
|
82
|
-
- 🗺️ Onboarding into repos
|
|
83
|
-
-
|
|
84
|
-
- 📐 Planning implementation work before code edits
|
|
85
|
-
- 🚀 Delivering features
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
76
|
+
### 🎯 Current Scope
|
|
77
|
+
|
|
78
|
+
The library has expanded beyond the original v1 scope. The current skill set covers 15 repeatable work patterns:
|
|
79
|
+
|
|
80
|
+
- 🧭 Routing requests with `using-skills`
|
|
81
|
+
- 💡 Refining ideas and writing specs with `brainstorming`
|
|
82
|
+
- 🗺️ Onboarding into unfamiliar repos with `repo-onboarding`
|
|
83
|
+
- 🔎 Researching existing code and patterns with `research`
|
|
84
|
+
- 📐 Planning implementation work before code edits with `planning`
|
|
85
|
+
- 🚀 Delivering features with `feature-delivery`
|
|
86
|
+
- 🧪 Implementing with test-first discipline through `test-driven-development`
|
|
87
|
+
- 🐛 Systematically debugging failures with `debug`
|
|
88
|
+
- ♻️ Refactoring safely with `refactor-safe`
|
|
89
|
+
- ✅ Verifying outcomes before claiming completion with `verification-before-completion`
|
|
90
|
+
- 🔍 Giving and receiving code reviews with `code-review`
|
|
91
|
+
- 📝 Creating intentional commits with `commit`
|
|
92
|
+
- 📖 Updating docs with `docs-writer`
|
|
93
|
+
- 🧬 Extracting reusable learnings with `extract`
|
|
94
|
+
- ⚡ Running an approved spec-to-commit flow with `go-pipeline`
|
|
89
95
|
|
|
90
96
|
### 🔮 Next Steps
|
|
91
97
|
|
package/i18n/CONTRIBUTING.vi.md
CHANGED
|
@@ -79,7 +79,7 @@ cp -r templates/ skills/<ten-skill>/
|
|
|
79
79
|
|---|---|---|
|
|
80
80
|
| `name` | ✅ | Định danh skill (kebab-case) |
|
|
81
81
|
| `version` | ✅ | Phiên bản semantic (`1.0.0`) |
|
|
82
|
-
| `category` | ✅ | Một trong: `routing`, `discovery`, `planning`, `implementation`, `
|
|
82
|
+
| `category` | ✅ | Một trong: `routing`, `discovery`, `planning`, `implementation`, `troubleshooting`, `review`, `documentation`, `quality`, `knowledge`, `workflow` |
|
|
83
83
|
| `summary` | ✅ | Mô tả một dòng bằng tiếng Anh |
|
|
84
84
|
| `summary_vi` | 🟡 | Mô tả một dòng bằng tiếng Việt |
|
|
85
85
|
| `triggers` | 🟡 | Khi nào kích hoạt skill |
|
|
@@ -161,6 +161,7 @@ File knowledge nằm trong `knowledge/global/`. Chúng chứa nguyên tắc, heu
|
|
|
161
161
|
| 🔍 `review-heuristics.md` | Quy tắc code review |
|
|
162
162
|
| 🐛 `debugging-patterns.md` | Phương pháp debug có hệ thống |
|
|
163
163
|
| 🧠 `skill-triggering-rules.md` | Khi nào load skill nào |
|
|
164
|
+
| 📋 `evidence-before-claims.md` | Yêu cầu bằng chứng trước tuyên bố hoàn thành |
|
|
164
165
|
|
|
165
166
|
Khi thêm hoặc sửa knowledge:
|
|
166
167
|
|
package/i18n/README.vi.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Thư viện skill đa agent, vendor-neutral cho kỹ thuật phần mềm hỗ trợ AI**
|
|
6
6
|
|
|
7
|
-
[](../skills/)
|
|
8
8
|
[](../knowledge/)
|
|
9
9
|
[](../adapters/)
|
|
10
10
|
[](../LICENSE)
|
|
@@ -51,15 +51,20 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
51
51
|
| | Skill | Mục đích |
|
|
52
52
|
|---|---|---|
|
|
53
53
|
| 🧭 | `using-skills` | Phân loại request và chọn đúng skill |
|
|
54
|
-
| 💡 | `brainstorming` |
|
|
54
|
+
| 💡 | `brainstorming` | Khám phá ý tưởng, khóa quyết định, viết spec nếu cần |
|
|
55
55
|
| 🗺️ | `repo-onboarding` | Hiểu codebase lạ trước khi hành động |
|
|
56
|
-
|
|
|
56
|
+
| 🔎 | `research` | Tìm hiểu code và pattern có sẵn trước khi implement |
|
|
57
|
+
| 📐 | `planning` | Plan thực thi với bước nhỏ gọn, không placeholder |
|
|
57
58
|
| 🚀 | `feature-delivery` | Triển khai feature với thay đổi tối thiểu, phù hợp repo |
|
|
58
|
-
|
|
|
59
|
+
| 🧪 | `test-driven-development` | Kỷ luật test-first với chu trình red-green-refactor |
|
|
60
|
+
| 🐛 | `debug` | Gỡ lỗi hệ thống 4 giai đoạn với điều tra nguyên nhân gốc |
|
|
59
61
|
| ♻️ | `refactor-safe` | Tái cấu trúc code mà không thay đổi hành vi |
|
|
60
|
-
| ✅ | `verification-before-completion` |
|
|
61
|
-
| 🔍 | `code-review` |
|
|
62
|
-
| 📝 | `
|
|
62
|
+
| ✅ | `verification-before-completion` | Luật sắt: không tuyên bố xong mà không có bằng chứng mới |
|
|
63
|
+
| 🔍 | `code-review` | Cho và nhận code review với phân loại mức độ |
|
|
64
|
+
| 📝 | `commit` | Tạo commit conventional với review thay đổi staged |
|
|
65
|
+
| 📖 | `docs-writer` | Cập nhật docs từ hành vi thực tế đã xác minh |
|
|
66
|
+
| 🧬 | `extract` | Trích xuất pattern, quyết định, bài học từ công việc |
|
|
67
|
+
| ⚡ | `go-pipeline` | Thực thi pipeline spec-to-commit trong một lượt |
|
|
63
68
|
|
|
64
69
|
### 🔄 Workflow Mặc Định
|
|
65
70
|
|
|
@@ -77,10 +82,13 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
77
82
|
┌────────────┼────────────┐
|
|
78
83
|
▼ ▼ ▼
|
|
79
84
|
┌────────────┐ ┌───────────┐ ┌──────────────┐
|
|
80
|
-
│ feature- │ │
|
|
85
|
+
│ feature- │ │ debug │ │ refactor-safe│
|
|
81
86
|
│ delivery │ │ │ │ │
|
|
82
87
|
└─────┬──────┘ └─────┬─────┘ └──────┬───────┘
|
|
83
88
|
│ │ │
|
|
89
|
+
│ ┌──────┴──────┐ │
|
|
90
|
+
│ │ TDD │ │
|
|
91
|
+
│ └──────┬──────┘ │
|
|
84
92
|
▼ ▼ ▼
|
|
85
93
|
┌─────────────────────────────────────────┐
|
|
86
94
|
│ verification-before-completion │
|
|
@@ -88,7 +96,11 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
88
96
|
▼
|
|
89
97
|
┌─────────────┐
|
|
90
98
|
│ code-review │
|
|
91
|
-
|
|
99
|
+
└──────┬──────┘
|
|
100
|
+
▼
|
|
101
|
+
┌──────────┐
|
|
102
|
+
│ commit │
|
|
103
|
+
└──────────┘
|
|
92
104
|
```
|
|
93
105
|
|
|
94
106
|
### 📖 Nghiên Cứu Tham Khảo
|
|
@@ -124,11 +136,18 @@ bash scripts/sync-platform-files
|
|
|
124
136
|
|
|
125
137
|
> Có sẵn trên [npm](https://www.npmjs.com/package/@anionzo/skill) — không cần xác thực
|
|
126
138
|
|
|
139
|
+
```bash
|
|
140
|
+
# Khuyên dùng: một lệnh, không tạo package.json
|
|
141
|
+
npx @anionzo/skill
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Hoặc thêm như dependency của project (tạo package.json):
|
|
145
|
+
|
|
127
146
|
```bash
|
|
128
147
|
npm install @anionzo/skill
|
|
129
148
|
```
|
|
130
149
|
|
|
131
|
-
|
|
150
|
+
Skill tự động được cài vào:
|
|
132
151
|
|
|
133
152
|
- `.opencode/skills/` — cho OpenCode
|
|
134
153
|
- `.claude/skills/` — cho Claude Code
|
package/i18n/design-brief.vi.md
CHANGED
|
@@ -73,19 +73,25 @@ Thư viện vận hành cá nhân với ba lớp:
|
|
|
73
73
|
5. ⚙️ Phiên bản đầu dùng shell script đơn giản thay vì build system
|
|
74
74
|
6. ✅ Planning và verification là các pha rõ ràng cho công việc thay đổi code
|
|
75
75
|
|
|
76
|
-
### 🎯 Phạm Vi
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- 🧭 Phân loại request
|
|
81
|
-
- 💡 Làm rõ
|
|
82
|
-
- 🗺️ Onboard vào repo
|
|
83
|
-
-
|
|
84
|
-
- 📐 Lập plan trước khi code
|
|
85
|
-
- 🚀 Triển khai feature
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
76
|
+
### 🎯 Phạm Vi Hiện Tại
|
|
77
|
+
|
|
78
|
+
Thư viện đã mở rộng vượt quá phạm vi v1 ban đầu. Bộ skill hiện tại bao phủ 15 pattern công việc lặp lại:
|
|
79
|
+
|
|
80
|
+
- 🧭 Phân loại request với `using-skills`
|
|
81
|
+
- 💡 Làm rõ ý tưởng và viết spec với `brainstorming`
|
|
82
|
+
- 🗺️ Onboard vào repo lạ với `repo-onboarding`
|
|
83
|
+
- 🔎 Nghiên cứu code và pattern có sẵn với `research`
|
|
84
|
+
- 📐 Lập plan trước khi code với `planning`
|
|
85
|
+
- 🚀 Triển khai feature với `feature-delivery`
|
|
86
|
+
- 🧪 Implement theo test-first với `test-driven-development`
|
|
87
|
+
- 🐛 Gỡ lỗi có hệ thống với `debug`
|
|
88
|
+
- ♻️ Refactor an toàn với `refactor-safe`
|
|
89
|
+
- ✅ Xác minh kết quả trước khi tuyên bố hoàn thành với `verification-before-completion`
|
|
90
|
+
- 🔍 Cho và nhận code review với `code-review`
|
|
91
|
+
- 📝 Tạo commit có chủ đích với `commit`
|
|
92
|
+
- 📖 Cập nhật tài liệu với `docs-writer`
|
|
93
|
+
- 🧬 Trích xuất bài học tái sử dụng với `extract`
|
|
94
|
+
- ⚡ Chạy luồng spec-to-commit đã được duyệt với `go-pipeline`
|
|
89
95
|
|
|
90
96
|
### 🔮 Bước Tiếp Theo
|
|
91
97
|
|
|
@@ -10,7 +10,8 @@ These notes keep the library behavior consistent across agents and sessions.
|
|
|
10
10
|
- Use `brainstorming` when the request is still fuzzy and the user is really asking for a clarified direction.
|
|
11
11
|
- Use `planning` before code changes for multi-file, ambiguous, or higher-risk work.
|
|
12
12
|
- Use `feature-delivery` only after the implementation path is concrete enough to execute.
|
|
13
|
-
- Use `
|
|
13
|
+
- Use `debug` before fixing an issue whose cause is not yet grounded.
|
|
14
|
+
- Use `test-driven-development` when implementing with TDD discipline (red-green-refactor).
|
|
14
15
|
- Use `verification-before-completion` before any strong success claim.
|
|
15
16
|
- Use `code-review` for review requests and post-implementation risk checks.
|
|
16
17
|
- Use `repo-onboarding` when entering an unfamiliar codebase before productive work can begin.
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env sh
|
|
2
2
|
|
|
3
|
-
# Install skills into
|
|
3
|
+
# Install AI skills into agent-specific directories
|
|
4
4
|
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
5
|
+
# Interactive mode (npx): shows menu to pick platforms
|
|
6
|
+
# Silent mode (postinstall): installs all platforms automatically
|
|
7
7
|
#
|
|
8
|
-
#
|
|
8
|
+
# Usage:
|
|
9
|
+
# npx @anionzo/skill # interactive
|
|
10
|
+
# npm install @anionzo/skill # auto (postinstall)
|
|
9
11
|
# bash scripts/install-opencode-skills [project-dir]
|
|
10
12
|
|
|
11
13
|
set -eu
|
|
@@ -27,6 +29,8 @@ case "$PROJECT" in
|
|
|
27
29
|
*/node_modules/*) exit 0 ;;
|
|
28
30
|
esac
|
|
29
31
|
|
|
32
|
+
# --- Skill installer ---
|
|
33
|
+
|
|
30
34
|
install_skills() {
|
|
31
35
|
target_dir="$1"
|
|
32
36
|
format_name="$2"
|
|
@@ -63,15 +67,160 @@ install_skills() {
|
|
|
63
67
|
printf ' %s: %d skills -> %s\n' "$format_name" "$count" "$target_dir"
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
# --- Agent instruction file generator ---
|
|
71
|
+
|
|
72
|
+
build_catalog() {
|
|
73
|
+
catalog=""
|
|
74
|
+
for meta in "$ROOT"/skills/*/meta.yaml; do
|
|
75
|
+
[ -f "$meta" ] || continue
|
|
76
|
+
name=$(sed -n 's/^name:[[:space:]]*//p' "$meta" | sed -n '1p')
|
|
77
|
+
summary=$(sed -n 's/^summary:[[:space:]]*//p' "$meta" | sed -n '1p')
|
|
78
|
+
catalog="$catalog$name|$summary
|
|
79
|
+
"
|
|
80
|
+
done
|
|
81
|
+
printf '%s' "$catalog"
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
write_agent_file() {
|
|
85
|
+
title=$1
|
|
86
|
+
target=$2
|
|
87
|
+
catalog=$3
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
printf '<!-- Generated by @anionzo/skill -->\n'
|
|
91
|
+
printf '# %s\n\n' "$title"
|
|
92
|
+
printf 'Start with `skills/using-skills/SKILL.md` when the task shape is unclear. Use one primary skill at a time, then pull in the smallest amount of supporting knowledge needed.\n\n'
|
|
93
|
+
|
|
94
|
+
printf '## Core Files\n\n'
|
|
95
|
+
printf -- '- `skills/using-skills/SKILL.md`\n'
|
|
96
|
+
printf -- '- `knowledge/global/engineering-principles.md`\n'
|
|
97
|
+
printf -- '- `knowledge/global/review-heuristics.md`\n'
|
|
98
|
+
printf -- '- `knowledge/global/debugging-patterns.md`\n'
|
|
99
|
+
printf -- '- `knowledge/global/evidence-before-claims.md`\n'
|
|
100
|
+
printf -- '- `knowledge/global/skill-triggering-rules.md`\n'
|
|
101
|
+
printf -- '- `docs/skill-spec.md`\n\n'
|
|
102
|
+
|
|
103
|
+
printf '## Working Rules\n\n'
|
|
104
|
+
printf -- '- Prefer the smallest correct change.\n'
|
|
105
|
+
printf -- '- Read the repo and nearby patterns before editing.\n'
|
|
106
|
+
printf -- '- Ask only the shortest blocking question when a decision is missing.\n'
|
|
107
|
+
printf -- '- Verify important claims with code, tests, or commands when possible.\n'
|
|
108
|
+
printf -- '- Keep summaries concise and grounded in files you inspected.\n\n'
|
|
109
|
+
|
|
110
|
+
printf '## Skill Catalog\n\n'
|
|
111
|
+
printf '%s' "$catalog" | while IFS='|' read -r name summary; do
|
|
112
|
+
[ -n "$name" ] || continue
|
|
113
|
+
printf -- '- `%s`: %s\n' "$name" "$summary"
|
|
114
|
+
done
|
|
115
|
+
|
|
116
|
+
printf '\n## Suggested Flow\n\n'
|
|
117
|
+
printf '1. Route with `using-skills` when unsure.\n'
|
|
118
|
+
printf '2. Load one primary skill that matches the current task.\n'
|
|
119
|
+
printf '3. Pull in `knowledge/project/` notes when working inside a real project.\n'
|
|
120
|
+
printf '4. Verify the outcome before declaring the work complete.\n'
|
|
121
|
+
} > "$target"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
# --- Platform definitions ---
|
|
125
|
+
|
|
126
|
+
# Each platform: skill_dir | agent_file | agent_title | display_name
|
|
127
|
+
PLATFORMS="
|
|
128
|
+
opencode|.opencode/skills|OPENCODE.md|OpenCode Instructions|OpenCode
|
|
129
|
+
claude|.claude/skills|CLAUDE.md|Claude Code Instructions|Claude Code
|
|
130
|
+
agents|.agents/skills|AGENTS.md|Generic Agent Instructions|Agents (generic)
|
|
131
|
+
gemini||GEMINI.md|Gemini Instructions|Gemini CLI
|
|
132
|
+
copilot||.github/copilot-instructions.md|GitHub Copilot Instructions|GitHub Copilot
|
|
133
|
+
"
|
|
134
|
+
|
|
135
|
+
# --- Interactive mode detection ---
|
|
136
|
+
|
|
137
|
+
is_interactive() {
|
|
138
|
+
# postinstall (npm) sets INIT_CWD — skip interactive
|
|
139
|
+
[ -z "${INIT_CWD:-}" ] && [ -t 0 ]
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
# --- Main ---
|
|
143
|
+
|
|
144
|
+
printf '\n'
|
|
145
|
+
printf ' @anionzo/skill — AI Skill Library\n'
|
|
146
|
+
printf ' ==================================\n\n'
|
|
147
|
+
|
|
148
|
+
if is_interactive; then
|
|
149
|
+
# --- Interactive: let user pick platforms ---
|
|
150
|
+
|
|
151
|
+
printf ' Which platforms do you want to install?\n\n'
|
|
152
|
+
printf ' [1] OpenCode (.opencode/skills/ + OPENCODE.md)\n'
|
|
153
|
+
printf ' [2] Claude Code (.claude/skills/ + CLAUDE.md)\n'
|
|
154
|
+
printf ' [3] Agents (generic)(.agents/skills/ + AGENTS.md)\n'
|
|
155
|
+
printf ' [4] Gemini CLI (GEMINI.md)\n'
|
|
156
|
+
printf ' [5] GitHub Copilot (.github/copilot-instructions.md)\n'
|
|
157
|
+
printf ' [a] All of the above\n\n'
|
|
158
|
+
|
|
159
|
+
printf ' Enter choices (e.g. 1 2 3, or a for all): '
|
|
160
|
+
read -r choices
|
|
161
|
+
|
|
162
|
+
# Normalize
|
|
163
|
+
case "$choices" in
|
|
164
|
+
*[aA]*) choices="1 2 3 4 5" ;;
|
|
165
|
+
esac
|
|
166
|
+
|
|
167
|
+
# Parse choices into flags
|
|
168
|
+
do_opencode=0; do_claude=0; do_agents=0; do_gemini=0; do_copilot=0
|
|
169
|
+
|
|
170
|
+
for c in $choices; do
|
|
171
|
+
case "$c" in
|
|
172
|
+
1) do_opencode=1 ;;
|
|
173
|
+
2) do_claude=1 ;;
|
|
174
|
+
3) do_agents=1 ;;
|
|
175
|
+
4) do_gemini=1 ;;
|
|
176
|
+
5) do_copilot=1 ;;
|
|
177
|
+
esac
|
|
178
|
+
done
|
|
179
|
+
|
|
180
|
+
# Check if anything was selected
|
|
181
|
+
total=$((do_opencode + do_claude + do_agents + do_gemini + do_copilot))
|
|
182
|
+
if [ "$total" -eq 0 ]; then
|
|
183
|
+
printf '\n Nothing selected. Exiting.\n\n'
|
|
184
|
+
exit 0
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
catalog=$(build_catalog)
|
|
188
|
+
|
|
189
|
+
printf '\n Installing...\n\n'
|
|
190
|
+
|
|
191
|
+
if [ "$do_opencode" -eq 1 ]; then
|
|
192
|
+
install_skills "$PROJECT/.opencode/skills" "OpenCode"
|
|
193
|
+
write_agent_file "OpenCode Instructions" "$PROJECT/OPENCODE.md" "$catalog"
|
|
194
|
+
printf ' -> OPENCODE.md\n'
|
|
195
|
+
fi
|
|
196
|
+
if [ "$do_claude" -eq 1 ]; then
|
|
197
|
+
install_skills "$PROJECT/.claude/skills" "Claude"
|
|
198
|
+
write_agent_file "Claude Code Instructions" "$PROJECT/CLAUDE.md" "$catalog"
|
|
199
|
+
printf ' -> CLAUDE.md\n'
|
|
200
|
+
fi
|
|
201
|
+
if [ "$do_agents" -eq 1 ]; then
|
|
202
|
+
install_skills "$PROJECT/.agents/skills" "Agents"
|
|
203
|
+
write_agent_file "Generic Agent Instructions" "$PROJECT/AGENTS.md" "$catalog"
|
|
204
|
+
printf ' -> AGENTS.md\n'
|
|
205
|
+
fi
|
|
206
|
+
if [ "$do_gemini" -eq 1 ]; then
|
|
207
|
+
write_agent_file "Gemini Instructions" "$PROJECT/GEMINI.md" "$catalog"
|
|
208
|
+
printf ' -> GEMINI.md\n'
|
|
209
|
+
fi
|
|
210
|
+
if [ "$do_copilot" -eq 1 ]; then
|
|
211
|
+
mkdir -p "$PROJECT/.github"
|
|
212
|
+
write_agent_file "GitHub Copilot Instructions" "$PROJECT/.github/copilot-instructions.md" "$catalog"
|
|
213
|
+
printf ' -> .github/copilot-instructions.md\n'
|
|
214
|
+
fi
|
|
67
215
|
|
|
68
|
-
|
|
69
|
-
|
|
216
|
+
else
|
|
217
|
+
# --- Silent mode: postinstall — install all skill dirs, no agent files ---
|
|
70
218
|
|
|
71
|
-
|
|
72
|
-
install_skills "$PROJECT/.claude/skills" "Claude"
|
|
219
|
+
printf ' Installing skills (postinstall)...\n\n'
|
|
73
220
|
|
|
74
|
-
|
|
75
|
-
install_skills "$PROJECT/.
|
|
221
|
+
install_skills "$PROJECT/.opencode/skills" "OpenCode"
|
|
222
|
+
install_skills "$PROJECT/.claude/skills" "Claude"
|
|
223
|
+
install_skills "$PROJECT/.agents/skills" "Agents"
|
|
224
|
+
fi
|
|
76
225
|
|
|
77
|
-
printf '\
|
|
226
|
+
printf '\n Done! Use /skill in your agent to see available skills.\n\n'
|