@anionzo/skill 1.6.0 → 1.7.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 +65 -19
- package/docs/design-brief.md +3 -5
- package/docs/knowledge-spec.md +1 -0
- package/i18n/README.vi.md +65 -19
- package/i18n/design-brief.vi.md +3 -5
- package/i18n/knowledge-spec.vi.md +1 -0
- package/knowledge/global/skill-triggering-rules.md +1 -1
- package/package.json +1 -1
- package/scripts/install-opencode-skills +197 -35
- package/skills/brainstorming/SKILL.md +3 -3
- package/skills/brainstorming/meta.yaml +0 -1
- package/skills/commit/meta.yaml +0 -1
- package/skills/debug/meta.yaml +1 -0
- package/skills/docs-writer/meta.yaml +2 -1
- package/skills/extract/SKILL.md +48 -8
- package/skills/extract/meta.yaml +12 -6
- package/skills/feature-delivery/SKILL.md +3 -1
- package/skills/feature-delivery/meta.yaml +2 -2
- package/skills/planning/SKILL.md +19 -1
- package/skills/planning/meta.yaml +8 -5
- package/skills/research/SKILL.md +33 -3
- package/skills/research/meta.yaml +9 -5
- package/skills/using-skills/SKILL.md +4 -6
- package/skills/using-skills/examples.md +17 -2
- package/skills/using-skills/meta.yaml +1 -3
- package/skills/verification-before-completion/meta.yaml +0 -1
- package/skills/go-pipeline/SKILL.md +0 -156
- package/skills/go-pipeline/examples.md +0 -56
- package/skills/go-pipeline/meta.yaml +0 -27
- package/skills/go-pipeline/references/output-template.md +0 -17
- package/skills/repo-onboarding/SKILL.md +0 -56
- package/skills/repo-onboarding/examples.md +0 -115
- package/skills/repo-onboarding/meta.yaml +0 -25
- package/skills/repo-onboarding/references/output-template.md +0 -24
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)
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
This repo is intentionally lighter than a full workflow product. It borrows the **workflow-first** mindset from `hoangnb24/skills`, the **plan-first** behavior from modern coding agents like OpenCode, and the **multi-platform** approach from `knowns-dev/knowns` — then turns them into a practical personal library.
|
|
25
25
|
|
|
26
|
+
The current library is intentionally consolidated: it keeps **13 higher-signal skills** instead of splitting every adjacent workflow into separate names. Overlapping flows such as repo onboarding, session handoff, and end-to-end go mode are folded into stronger core skills (`research`, `extract`, and `planning`) to reduce routing noise.
|
|
27
|
+
|
|
26
28
|
### 🏗️ Design Goals
|
|
27
29
|
|
|
28
30
|
| | Goal |
|
|
@@ -48,13 +50,14 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
48
50
|
|
|
49
51
|
### 🎯 Skill Catalog
|
|
50
52
|
|
|
53
|
+
This catalog is intentionally compact: each skill should own a clearly distinct job, and nearby workflows are merged unless the risk profile or working mode is meaningfully different.
|
|
54
|
+
|
|
51
55
|
| | Skill | Purpose |
|
|
52
56
|
|---|---|---|
|
|
53
57
|
| 🧭 | `using-skills` | Route a request to the right skill and working mode |
|
|
54
58
|
| 💡 | `brainstorming` | Explore ideas, lock decisions, optionally write a spec |
|
|
55
|
-
| 🗺️ | `repo-onboarding` | Understand an unfamiliar codebase before acting |
|
|
56
59
|
| 🔎 | `research` | Explore existing code and patterns before implementing |
|
|
57
|
-
| 📐 | `planning` | Execution-ready plans
|
|
60
|
+
| 📐 | `planning` | Execution-ready plans, plus optional go-mode execution for approved work |
|
|
58
61
|
| 🚀 | `feature-delivery` | Implement a feature with minimal, repo-aligned change |
|
|
59
62
|
| 🧪 | `test-driven-development` | Enforce test-first discipline with red-green-refactor |
|
|
60
63
|
| 🐛 | `debug` | 4-phase systematic debugging with root cause investigation |
|
|
@@ -63,20 +66,19 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
63
66
|
| 🔍 | `code-review` | Give and receive code reviews with severity triage |
|
|
64
67
|
| 📝 | `commit` | Create conventional commits with staged change review |
|
|
65
68
|
| 📖 | `docs-writer` | Update docs from verified source behavior |
|
|
66
|
-
| 🧬 | `extract` | Extract
|
|
67
|
-
| ⚡ | `go-pipeline` | Execute a full spec-to-commit pipeline in one run |
|
|
69
|
+
| 🧬 | `extract` | Extract durable learnings or compress active work into a handoff |
|
|
68
70
|
|
|
69
71
|
### 🔄 Default Workflow
|
|
70
72
|
|
|
71
73
|
```
|
|
72
74
|
┌─────────────┐ ┌───────────────┐ ┌─────────────────┐
|
|
73
|
-
│ using-skills │────▶│ brainstorming │────▶│
|
|
74
|
-
│ (router) │ │ (if vague) │ │
|
|
75
|
-
└──────┬───────┘ └───────┬───────┘
|
|
76
|
-
│ │
|
|
77
|
-
│ ▼
|
|
78
|
-
│ ┌──────────┐
|
|
79
|
-
└─────────────▶│ planning
|
|
75
|
+
│ using-skills │────▶│ brainstorming │────▶│ research │
|
|
76
|
+
│ (router) │ │ (if vague) │ │ (if needed) │
|
|
77
|
+
└──────┬───────┘ └───────┬───────┘ └──────┬──────┘
|
|
78
|
+
│ │ │
|
|
79
|
+
│ ▼ │
|
|
80
|
+
│ ┌──────────┐ │
|
|
81
|
+
└─────────────▶│ planning │◀────────────────┘
|
|
80
82
|
└────┬─────┘
|
|
81
83
|
│
|
|
82
84
|
┌────────────┼────────────┐
|
|
@@ -100,6 +102,10 @@ This repo is intentionally lighter than a full workflow product. It borrows the
|
|
|
100
102
|
▼
|
|
101
103
|
┌──────────┐
|
|
102
104
|
│ commit │
|
|
105
|
+
└────┬─────┘
|
|
106
|
+
▼
|
|
107
|
+
┌──────────┐
|
|
108
|
+
│ extract │
|
|
103
109
|
└──────────┘
|
|
104
110
|
```
|
|
105
111
|
|
|
@@ -117,23 +123,63 @@ This scaffold distills patterns from strong public repos:
|
|
|
117
123
|
|
|
118
124
|
### 🚀 Quick Start
|
|
119
125
|
|
|
126
|
+
#### Use the library
|
|
127
|
+
|
|
128
|
+
If you just want to use the skill library in your agent:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# 1. Install the library into your current project or workspace
|
|
132
|
+
npx @anionzo/skill
|
|
133
|
+
|
|
134
|
+
# 2. Open your agent in the target repo
|
|
135
|
+
# Then start with the router skill
|
|
136
|
+
an:using-skills
|
|
137
|
+
|
|
138
|
+
# 3. Ask naturally, for example:
|
|
139
|
+
# "Help me understand this repo"
|
|
140
|
+
# "Plan this feature first"
|
|
141
|
+
# "Review these changes"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
The router will pick the right primary skill and next step.
|
|
145
|
+
|
|
146
|
+
Installer behavior:
|
|
147
|
+
|
|
148
|
+
- `npx @anionzo/skill` opens an interactive terminal picker
|
|
149
|
+
- use **arrow keys** to move
|
|
150
|
+
- press **space** to select one or more platforms
|
|
151
|
+
- press **enter** to install the selected platforms
|
|
152
|
+
- you can also choose whether to update `.gitignore` with the installed agent files
|
|
153
|
+
- `npm install @anionzo/skill` still runs in silent postinstall mode and installs the default skill directories automatically
|
|
154
|
+
|
|
155
|
+
#### Edit or extend the library
|
|
156
|
+
|
|
157
|
+
If you want to customize this repository itself:
|
|
158
|
+
|
|
120
159
|
```bash
|
|
121
|
-
# 1.
|
|
122
|
-
|
|
160
|
+
# 1. Read the design and authoring docs
|
|
161
|
+
less docs/design-brief.md
|
|
162
|
+
less docs/authoring-guide.md
|
|
123
163
|
|
|
124
|
-
# 2.
|
|
164
|
+
# 2. Adjust global knowledge if you want different defaults
|
|
125
165
|
vim knowledge/global/engineering-principles.md
|
|
126
166
|
|
|
127
|
-
# 3.
|
|
128
|
-
|
|
167
|
+
# 3. Edit skills, docs, or adapters
|
|
168
|
+
vim skills/using-skills/SKILL.md
|
|
129
169
|
|
|
130
|
-
# 4. Validate
|
|
170
|
+
# 4. Validate the library structure
|
|
131
171
|
bash scripts/validate-skills
|
|
132
172
|
|
|
133
|
-
# 5.
|
|
173
|
+
# 5. Regenerate platform files after skill/knowledge changes
|
|
134
174
|
bash scripts/sync-platform-files
|
|
135
175
|
```
|
|
136
176
|
|
|
177
|
+
Notes:
|
|
178
|
+
|
|
179
|
+
- `bash scripts/validate-skills` checks required files, metadata keys, and basic library consistency.
|
|
180
|
+
- `bash scripts/sync-platform-files` regenerates the files in `generated/` for each target agent.
|
|
181
|
+
- You only need to run sync when skills, knowledge, adapters, or summaries change.
|
|
182
|
+
|
|
137
183
|
### 📦 Install via npm
|
|
138
184
|
|
|
139
185
|
> Available on [npm](https://www.npmjs.com/package/@anionzo/skill) — no authentication required
|
package/docs/design-brief.md
CHANGED
|
@@ -75,13 +75,12 @@ A personal operating library with three layers:
|
|
|
75
75
|
|
|
76
76
|
### 🎯 Current Scope
|
|
77
77
|
|
|
78
|
-
The library has expanded beyond the original v1 scope. The current skill set covers
|
|
78
|
+
The library has expanded beyond the original v1 scope. The current skill set covers 13 repeatable work patterns:
|
|
79
79
|
|
|
80
80
|
- 🧭 Routing requests with `using-skills`
|
|
81
81
|
- 💡 Refining ideas and writing specs with `brainstorming`
|
|
82
|
-
- 🗺️ Onboarding into unfamiliar repos with `repo-onboarding`
|
|
83
82
|
- 🔎 Researching existing code and patterns with `research`
|
|
84
|
-
- 📐 Planning implementation work before code edits with `planning`
|
|
83
|
+
- 📐 Planning implementation work before code edits, or running approved work in go mode, with `planning`
|
|
85
84
|
- 🚀 Delivering features with `feature-delivery`
|
|
86
85
|
- 🧪 Implementing with test-first discipline through `test-driven-development`
|
|
87
86
|
- 🐛 Systematically debugging failures with `debug`
|
|
@@ -90,8 +89,7 @@ The library has expanded beyond the original v1 scope. The current skill set cov
|
|
|
90
89
|
- 🔍 Giving and receiving code reviews with `code-review`
|
|
91
90
|
- 📝 Creating intentional commits with `commit`
|
|
92
91
|
- 📖 Updating docs with `docs-writer`
|
|
93
|
-
- 🧬 Extracting reusable learnings with `extract`
|
|
94
|
-
- ⚡ Running an approved spec-to-commit flow with `go-pipeline`
|
|
92
|
+
- 🧬 Extracting reusable learnings or handing work off between sessions with `extract`
|
|
95
93
|
|
|
96
94
|
### 🔮 Next Steps
|
|
97
95
|
|
package/docs/knowledge-spec.md
CHANGED
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)
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
|
|
24
24
|
Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy **workflow-first** từ `hoangnb24/skills`, hành vi **plan-first** từ các coding agent hiện đại như OpenCode, và tư duy **multi-platform** từ `knowns-dev/knowns` — rồi biến chúng thành thư viện cá nhân thực dụng.
|
|
25
25
|
|
|
26
|
+
Thư viện hiện tại được cô đọng có chủ đích: giữ **13 skill sắc nét hơn** thay vì tách mỗi workflow gần nhau thành một tên riêng. Các luồng bị chồng lắp như onboarding repo, handoff giữa session, và go mode end-to-end đã được nhập vào các skill lõi mạnh hơn (`research`, `extract`, và `planning`) để giảm nhiễu khi route.
|
|
27
|
+
|
|
26
28
|
### 🏗️ Mục Tiêu Thiết Kế
|
|
27
29
|
|
|
28
30
|
| | Mục tiêu |
|
|
@@ -48,13 +50,14 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
48
50
|
|
|
49
51
|
### 🎯 Danh Mục Skill
|
|
50
52
|
|
|
53
|
+
Catalog này được giữ gọn có chủ đích: mỗi skill nên sở hữu một nhiệm vụ thật sự khác biệt, còn các workflow gần nhau sẽ được gộp lại trừ khi mức rủi ro hoặc cách làm việc khác nhau rõ rệt.
|
|
54
|
+
|
|
51
55
|
| | Skill | Mục đích |
|
|
52
56
|
|---|---|---|
|
|
53
57
|
| 🧭 | `using-skills` | Phân loại request và chọn đúng skill |
|
|
54
58
|
| 💡 | `brainstorming` | Khám phá ý tưởng, khóa quyết định, viết spec nếu cần |
|
|
55
|
-
| 🗺️ | `repo-onboarding` | Hiểu codebase lạ trước khi hành động |
|
|
56
59
|
| 🔎 | `research` | Tìm hiểu code và pattern có sẵn trước khi implement |
|
|
57
|
-
| 📐 | `planning` | Plan thực thi
|
|
60
|
+
| 📐 | `planning` | Plan thực thi, kèm go mode cho công việc đã rõ và đã duyệt |
|
|
58
61
|
| 🚀 | `feature-delivery` | Triển khai feature với thay đổi tối thiểu, phù hợp repo |
|
|
59
62
|
| 🧪 | `test-driven-development` | Kỷ luật test-first với chu trình red-green-refactor |
|
|
60
63
|
| 🐛 | `debug` | Gỡ lỗi hệ thống 4 giai đoạn với điều tra nguyên nhân gốc |
|
|
@@ -63,20 +66,19 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
63
66
|
| 🔍 | `code-review` | Cho và nhận code review với phân loại mức độ |
|
|
64
67
|
| 📝 | `commit` | Tạo commit conventional với review thay đổi staged |
|
|
65
68
|
| 📖 | `docs-writer` | Cập nhật docs từ hành vi thực tế đã xác minh |
|
|
66
|
-
| 🧬 | `extract` | Trích xuất
|
|
67
|
-
| ⚡ | `go-pipeline` | Thực thi pipeline spec-to-commit trong một lượt |
|
|
69
|
+
| 🧬 | `extract` | Trích xuất bài học bền vững hoặc cô đọng công việc đang dở thành handoff |
|
|
68
70
|
|
|
69
71
|
### 🔄 Workflow Mặc Định
|
|
70
72
|
|
|
71
73
|
```
|
|
72
74
|
┌─────────────┐ ┌───────────────┐ ┌─────────────────┐
|
|
73
|
-
│ using-skills │────▶│ brainstorming │────▶│
|
|
74
|
-
│ (router) │ │ (nếu mơ hồ) │ │ (nếu
|
|
75
|
-
└──────┬───────┘ └───────┬───────┘
|
|
76
|
-
│ │
|
|
77
|
-
│ ▼
|
|
78
|
-
│ ┌──────────┐
|
|
79
|
-
└─────────────▶│ planning
|
|
75
|
+
│ using-skills │────▶│ brainstorming │────▶│ research │
|
|
76
|
+
│ (router) │ │ (nếu mơ hồ) │ │ (nếu cần) │
|
|
77
|
+
└──────┬───────┘ └───────┬───────┘ └──────┬──────┘
|
|
78
|
+
│ │ │
|
|
79
|
+
│ ▼ │
|
|
80
|
+
│ ┌──────────┐ │
|
|
81
|
+
└─────────────▶│ planning │◀────────────────┘
|
|
80
82
|
└────┬─────┘
|
|
81
83
|
│
|
|
82
84
|
┌────────────┼────────────┐
|
|
@@ -100,6 +102,10 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
100
102
|
▼
|
|
101
103
|
┌──────────┐
|
|
102
104
|
│ commit │
|
|
105
|
+
└────┬─────┘
|
|
106
|
+
▼
|
|
107
|
+
┌──────────┐
|
|
108
|
+
│ extract │
|
|
103
109
|
└──────────┘
|
|
104
110
|
```
|
|
105
111
|
|
|
@@ -115,23 +121,63 @@ Repo này nhẹ hơn một sản phẩm workflow đầy đủ. Nó lấy tư duy
|
|
|
115
121
|
|
|
116
122
|
### 🚀 Bắt Đầu Nhanh
|
|
117
123
|
|
|
124
|
+
#### Dùng thư viện
|
|
125
|
+
|
|
126
|
+
Nếu bạn chỉ muốn dùng skill library trong agent của mình:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# 1. Cài thư viện vào project hoặc workspace hiện tại
|
|
130
|
+
npx @anionzo/skill
|
|
131
|
+
|
|
132
|
+
# 2. Mở agent trong repo đích
|
|
133
|
+
# Sau đó bắt đầu bằng router skill
|
|
134
|
+
an:using-skills
|
|
135
|
+
|
|
136
|
+
# 3. Hỏi tự nhiên, ví dụ:
|
|
137
|
+
# "Help me understand this repo"
|
|
138
|
+
# "Plan this feature first"
|
|
139
|
+
# "Review these changes"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Router sẽ chọn đúng skill chính và bước tiếp theo.
|
|
143
|
+
|
|
144
|
+
Hành vi của installer:
|
|
145
|
+
|
|
146
|
+
- `npx @anionzo/skill` sẽ mở terminal picker tương tác
|
|
147
|
+
- dùng **phím mũi tên** để di chuyển
|
|
148
|
+
- nhấn **space** để chọn một hoặc nhiều platform
|
|
149
|
+
- nhấn **enter** để cài các platform đã chọn
|
|
150
|
+
- bạn cũng có thể chọn cập nhật `.gitignore` cho các file agent vừa cài
|
|
151
|
+
- `npm install @anionzo/skill` vẫn chạy theo postinstall silent mode và tự cài các thư mục skill mặc định
|
|
152
|
+
|
|
153
|
+
#### Sửa hoặc mở rộng thư viện
|
|
154
|
+
|
|
155
|
+
Nếu bạn muốn tùy biến chính repo này:
|
|
156
|
+
|
|
118
157
|
```bash
|
|
119
|
-
# 1.
|
|
120
|
-
|
|
158
|
+
# 1. Đọc tài liệu thiết kế và quy tắc viết
|
|
159
|
+
less docs/design-brief.md
|
|
160
|
+
less docs/authoring-guide.md
|
|
121
161
|
|
|
122
|
-
# 2.
|
|
162
|
+
# 2. Chỉnh knowledge global nếu muốn đổi default behavior
|
|
123
163
|
vim knowledge/global/engineering-principles.md
|
|
124
164
|
|
|
125
|
-
# 3.
|
|
126
|
-
|
|
165
|
+
# 3. Sửa skill, docs, hoặc adapters
|
|
166
|
+
vim skills/using-skills/SKILL.md
|
|
127
167
|
|
|
128
|
-
# 4. Validate
|
|
168
|
+
# 4. Validate cấu trúc thư viện
|
|
129
169
|
bash scripts/validate-skills
|
|
130
170
|
|
|
131
|
-
# 5. Sinh platform file
|
|
171
|
+
# 5. Sinh lại platform file sau khi đổi skill/knowledge
|
|
132
172
|
bash scripts/sync-platform-files
|
|
133
173
|
```
|
|
134
174
|
|
|
175
|
+
Ghi chú:
|
|
176
|
+
|
|
177
|
+
- `bash scripts/validate-skills` kiểm tra file bắt buộc, key metadata, và tính nhất quán cơ bản của thư viện.
|
|
178
|
+
- `bash scripts/sync-platform-files` sinh lại các file trong `generated/` cho từng agent đích.
|
|
179
|
+
- Chỉ cần chạy sync khi skill, knowledge, adapter, hoặc summary thay đổi.
|
|
180
|
+
|
|
135
181
|
### 📦 Cài Đặt Qua npm
|
|
136
182
|
|
|
137
183
|
> Có sẵn trên [npm](https://www.npmjs.com/package/@anionzo/skill) — không cần xác thực
|
package/i18n/design-brief.vi.md
CHANGED
|
@@ -75,13 +75,12 @@ Thư viện vận hành cá nhân với ba lớp:
|
|
|
75
75
|
|
|
76
76
|
### 🎯 Phạm Vi Hiện Tại
|
|
77
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ủ
|
|
78
|
+
Thư viện đã mở rộng vượt quá phạm vi v1 ban đầu. Bộ skill hiện tại bao phủ 13 pattern công việc lặp lại:
|
|
79
79
|
|
|
80
80
|
- 🧭 Phân loại request với `using-skills`
|
|
81
81
|
- 💡 Làm rõ ý tưởng và viết spec với `brainstorming`
|
|
82
|
-
- 🗺️ Onboard vào repo lạ với `repo-onboarding`
|
|
83
82
|
- 🔎 Nghiên cứu code và pattern có sẵn với `research`
|
|
84
|
-
- 📐 Lập plan trước khi code với `planning`
|
|
83
|
+
- 📐 Lập plan trước khi code, hoặc chạy theo go mode khi công việc đã rõ, với `planning`
|
|
85
84
|
- 🚀 Triển khai feature với `feature-delivery`
|
|
86
85
|
- 🧪 Implement theo test-first với `test-driven-development`
|
|
87
86
|
- 🐛 Gỡ lỗi có hệ thống với `debug`
|
|
@@ -90,8 +89,7 @@ Thư viện đã mở rộng vượt quá phạm vi v1 ban đầu. Bộ skill hi
|
|
|
90
89
|
- 🔍 Cho và nhận code review với `code-review`
|
|
91
90
|
- 📝 Tạo commit có chủ đích với `commit`
|
|
92
91
|
- 📖 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`
|
|
92
|
+
- 🧬 Trích xuất bài học tái sử dụng hoặc handoff công việc giữa các session với `extract`
|
|
95
93
|
|
|
96
94
|
### 🔮 Bước Tiếp Theo
|
|
97
95
|
|
|
@@ -14,7 +14,7 @@ These notes keep the library behavior consistent across agents and sessions.
|
|
|
14
14
|
- Use `test-driven-development` when implementing with TDD discipline (red-green-refactor).
|
|
15
15
|
- Use `verification-before-completion` before any strong success claim.
|
|
16
16
|
- Use `code-review` for review requests and post-implementation risk checks.
|
|
17
|
-
- Use `
|
|
17
|
+
- Use `research` when entering an unfamiliar codebase before productive work can begin.
|
|
18
18
|
- Use `docs-writer` for documentation tasks in a repo whose structure is already understood.
|
|
19
19
|
- Use `refactor-safe` for restructuring, extracting, or migrating code without intended behavior change.
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
# Install AI skills into agent-specific directories
|
|
4
4
|
#
|
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
# npm install @anionzo/skill # auto (postinstall)
|
|
11
11
|
# bash scripts/install-opencode-skills [project-dir]
|
|
12
12
|
|
|
13
|
-
set -
|
|
13
|
+
set -euo pipefail
|
|
14
14
|
|
|
15
15
|
SCRIPT_PATH=$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")
|
|
16
16
|
ROOT=$(CDPATH= cd -- "$(dirname "$SCRIPT_PATH")/.." && pwd)
|
|
17
17
|
|
|
18
|
-
# Determine project root:
|
|
18
|
+
# Determine project root:
|
|
19
|
+
# 1. explicit arg
|
|
20
|
+
# 2. npm_config_local_prefix during lifecycle scripts (correct for npm install --prefix)
|
|
21
|
+
# 3. INIT_CWD (npm invocation cwd)
|
|
22
|
+
# 4. current dir
|
|
19
23
|
if [ -n "${1:-}" ]; then
|
|
20
24
|
PROJECT="$1"
|
|
25
|
+
elif [ "${npm_lifecycle_event:-}" = "postinstall" ] && [ -n "${npm_config_local_prefix:-}" ]; then
|
|
26
|
+
PROJECT="$npm_config_local_prefix"
|
|
21
27
|
elif [ -n "${INIT_CWD:-}" ]; then
|
|
22
28
|
PROJECT="$INIT_CWD"
|
|
23
29
|
else
|
|
@@ -135,8 +141,180 @@ copilot||.github/copilot-instructions.md|GitHub Copilot Instructions|GitHub Copi
|
|
|
135
141
|
# --- Interactive mode detection ---
|
|
136
142
|
|
|
137
143
|
is_interactive() {
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
[ "${npm_lifecycle_event:-}" != "postinstall" ] && [ -t 0 ] && [ -t 1 ]
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
# --- Interactive picker ---
|
|
148
|
+
|
|
149
|
+
MENU_LABELS=(
|
|
150
|
+
"OpenCode (.opencode/skills/ + OPENCODE.md)"
|
|
151
|
+
"Claude Code (.claude/skills/ + CLAUDE.md)"
|
|
152
|
+
"Agents (generic)(.agents/skills/ + AGENTS.md)"
|
|
153
|
+
"Gemini CLI (GEMINI.md)"
|
|
154
|
+
"GitHub Copilot (.github/copilot-instructions.md)"
|
|
155
|
+
"Update .gitignore with selected platform files"
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
read_key() {
|
|
159
|
+
local key rest final
|
|
160
|
+
|
|
161
|
+
IFS= read -rsn1 key || return 1
|
|
162
|
+
|
|
163
|
+
if [ "$key" = $'\x1b' ]; then
|
|
164
|
+
IFS= read -rsn1 -t 0.1 rest || true
|
|
165
|
+
if [ "$rest" = "[" ]; then
|
|
166
|
+
IFS= read -rsn1 -t 0.1 final || true
|
|
167
|
+
printf '\033[%s' "$final"
|
|
168
|
+
else
|
|
169
|
+
printf '\033%s' "$rest"
|
|
170
|
+
fi
|
|
171
|
+
return 0
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
printf '%s' "$key"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
render_menu() {
|
|
178
|
+
local cursor="$1"
|
|
179
|
+
shift
|
|
180
|
+
local -a state=("$@")
|
|
181
|
+
local i mark prefix
|
|
182
|
+
|
|
183
|
+
printf '\033[H\033[2J'
|
|
184
|
+
printf '\n'
|
|
185
|
+
printf ' @anionzo/skill -- AI Skill Library\n'
|
|
186
|
+
printf ' ==================================\n\n'
|
|
187
|
+
printf ' Use arrow keys to move, space to toggle, enter to install.\n'
|
|
188
|
+
printf ' Press a to toggle all platforms, q to cancel.\n\n'
|
|
189
|
+
|
|
190
|
+
for i in "${!MENU_LABELS[@]}"; do
|
|
191
|
+
[ "$i" -eq 5 ] && printf '\n'
|
|
192
|
+
|
|
193
|
+
if [ "${state[$i]}" -eq 1 ]; then
|
|
194
|
+
mark='[x]'
|
|
195
|
+
else
|
|
196
|
+
mark='[ ]'
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
if [ "$i" -eq "$cursor" ]; then
|
|
200
|
+
prefix='>'
|
|
201
|
+
else
|
|
202
|
+
prefix=' '
|
|
203
|
+
fi
|
|
204
|
+
|
|
205
|
+
printf ' %s %s %s\n' "$prefix" "$mark" "${MENU_LABELS[$i]}"
|
|
206
|
+
done
|
|
207
|
+
|
|
208
|
+
printf '\n'
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
toggle_all_platforms() {
|
|
212
|
+
local -n state_ref=$1
|
|
213
|
+
local sum=0
|
|
214
|
+
local i next=1
|
|
215
|
+
|
|
216
|
+
for i in 0 1 2 3 4; do
|
|
217
|
+
sum=$((sum + state_ref[$i]))
|
|
218
|
+
done
|
|
219
|
+
|
|
220
|
+
[ "$sum" -eq 5 ] && next=0
|
|
221
|
+
|
|
222
|
+
for i in 0 1 2 3 4; do
|
|
223
|
+
state_ref[$i]=$next
|
|
224
|
+
done
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interactive_select() {
|
|
228
|
+
local cursor=0
|
|
229
|
+
local key
|
|
230
|
+
local -a selected=(0 0 0 0 0 0)
|
|
231
|
+
|
|
232
|
+
while true; do
|
|
233
|
+
render_menu "$cursor" "${selected[@]}"
|
|
234
|
+
key=$(read_key) || exit 0
|
|
235
|
+
|
|
236
|
+
case "$key" in
|
|
237
|
+
$'\033[A')
|
|
238
|
+
if [ "$cursor" -eq 0 ]; then
|
|
239
|
+
cursor=$((${#MENU_LABELS[@]} - 1))
|
|
240
|
+
else
|
|
241
|
+
cursor=$((cursor - 1))
|
|
242
|
+
fi
|
|
243
|
+
;;
|
|
244
|
+
$'\033[B')
|
|
245
|
+
if [ "$cursor" -eq $((${#MENU_LABELS[@]} - 1)) ]; then
|
|
246
|
+
cursor=0
|
|
247
|
+
else
|
|
248
|
+
cursor=$((cursor + 1))
|
|
249
|
+
fi
|
|
250
|
+
;;
|
|
251
|
+
"")
|
|
252
|
+
break
|
|
253
|
+
;;
|
|
254
|
+
" ")
|
|
255
|
+
if [ "${selected[$cursor]}" -eq 1 ]; then
|
|
256
|
+
selected[$cursor]=0
|
|
257
|
+
else
|
|
258
|
+
selected[$cursor]=1
|
|
259
|
+
fi
|
|
260
|
+
;;
|
|
261
|
+
[aA])
|
|
262
|
+
toggle_all_platforms selected
|
|
263
|
+
;;
|
|
264
|
+
[qQ])
|
|
265
|
+
printf '\n Cancelled.\n\n'
|
|
266
|
+
exit 0
|
|
267
|
+
;;
|
|
268
|
+
esac
|
|
269
|
+
done
|
|
270
|
+
|
|
271
|
+
printf '%s\n' "${selected[@]}"
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
update_gitignore() {
|
|
275
|
+
local gitignore="$PROJECT/.gitignore"
|
|
276
|
+
local -a entries=()
|
|
277
|
+
local -a missing=()
|
|
278
|
+
local header_needed=0
|
|
279
|
+
local entry
|
|
280
|
+
|
|
281
|
+
[ "${do_opencode:-0}" -eq 1 ] && entries+=(".opencode/" "OPENCODE.md")
|
|
282
|
+
[ "${do_claude:-0}" -eq 1 ] && entries+=(".claude/" "CLAUDE.md")
|
|
283
|
+
[ "${do_agents:-0}" -eq 1 ] && entries+=(".agents/" "AGENTS.md")
|
|
284
|
+
[ "${do_gemini:-0}" -eq 1 ] && entries+=("GEMINI.md")
|
|
285
|
+
[ "${do_copilot:-0}" -eq 1 ] && entries+=(".github/copilot-instructions.md")
|
|
286
|
+
|
|
287
|
+
if [ "${#entries[@]}" -eq 0 ]; then
|
|
288
|
+
printf ' .gitignore: skipped (no platform files selected)\n'
|
|
289
|
+
return
|
|
290
|
+
fi
|
|
291
|
+
|
|
292
|
+
touch "$gitignore"
|
|
293
|
+
|
|
294
|
+
if ! grep -Fqx '# @anionzo/skill' "$gitignore" 2>/dev/null; then
|
|
295
|
+
header_needed=1
|
|
296
|
+
fi
|
|
297
|
+
|
|
298
|
+
for entry in "${entries[@]}"; do
|
|
299
|
+
if ! grep -Fqx "$entry" "$gitignore" 2>/dev/null; then
|
|
300
|
+
missing+=("$entry")
|
|
301
|
+
fi
|
|
302
|
+
done
|
|
303
|
+
|
|
304
|
+
if [ "${#missing[@]}" -eq 0 ]; then
|
|
305
|
+
printf ' .gitignore: already up to date -> %s\n' "$gitignore"
|
|
306
|
+
return
|
|
307
|
+
fi
|
|
308
|
+
|
|
309
|
+
if [ "$header_needed" -eq 1 ]; then
|
|
310
|
+
printf '\n# @anionzo/skill\n' >> "$gitignore"
|
|
311
|
+
fi
|
|
312
|
+
|
|
313
|
+
for entry in "${missing[@]}"; do
|
|
314
|
+
printf '%s\n' "$entry" >> "$gitignore"
|
|
315
|
+
done
|
|
316
|
+
|
|
317
|
+
printf ' .gitignore: added %d entries -> %s\n' "${#missing[@]}" "$gitignore"
|
|
140
318
|
}
|
|
141
319
|
|
|
142
320
|
# --- Main ---
|
|
@@ -146,36 +324,16 @@ printf ' @anionzo/skill — AI Skill Library\n'
|
|
|
146
324
|
printf ' ==================================\n\n'
|
|
147
325
|
|
|
148
326
|
if is_interactive; then
|
|
149
|
-
# --- Interactive: let user pick platforms ---
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
|
327
|
+
# --- Interactive: let user pick platforms with arrows + space ---
|
|
328
|
+
|
|
329
|
+
mapfile -t selected < <(interactive_select)
|
|
330
|
+
|
|
331
|
+
do_opencode=${selected[0]}
|
|
332
|
+
do_claude=${selected[1]}
|
|
333
|
+
do_agents=${selected[2]}
|
|
334
|
+
do_gemini=${selected[3]}
|
|
335
|
+
do_copilot=${selected[4]}
|
|
336
|
+
do_gitignore=${selected[5]}
|
|
179
337
|
|
|
180
338
|
# Check if anything was selected
|
|
181
339
|
total=$((do_opencode + do_claude + do_agents + do_gemini + do_copilot))
|
|
@@ -213,6 +371,10 @@ if is_interactive; then
|
|
|
213
371
|
printf ' -> .github/copilot-instructions.md\n'
|
|
214
372
|
fi
|
|
215
373
|
|
|
374
|
+
if [ "$do_gitignore" -eq 1 ]; then
|
|
375
|
+
update_gitignore
|
|
376
|
+
fi
|
|
377
|
+
|
|
216
378
|
else
|
|
217
379
|
# --- Silent mode: postinstall — install all skill dirs, no agent files ---
|
|
218
380
|
|
|
@@ -175,9 +175,9 @@ Present results using the Shared Output Contract:
|
|
|
175
175
|
- acceptance criteria (if spec written)
|
|
176
176
|
- open questions
|
|
177
177
|
3. **Next Action** — after approval:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
- to review each step: `planning` (with spec reference)
|
|
179
|
+
- to execute everything at once: `planning` in go mode (with spec reference)
|
|
180
|
+
- if requirements still unclear: state what decision is still needed
|
|
181
181
|
|
|
182
182
|
## Red Flags
|
|
183
183
|
|