add-skill-kit 3.2.4 → 3.2.6
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 +179 -119
- package/bin/lib/commands/help.js +0 -4
- package/bin/lib/commands/install.js +129 -9
- package/bin/lib/ui.js +1 -1
- package/lib/agent-cli/__tests__/adaptive_engine.test.js +190 -0
- package/lib/agent-cli/__tests__/integration/cross_script.test.js +222 -0
- package/lib/agent-cli/__tests__/integration/full_cycle.test.js +230 -0
- package/lib/agent-cli/__tests__/pattern_analyzer.test.js +173 -0
- package/lib/agent-cli/__tests__/pre_execution_check.test.js +167 -0
- package/lib/agent-cli/__tests__/skill_injector.test.js +191 -0
- package/lib/agent-cli/bin/{ag-smart.js → agent.js} +48 -15
- package/lib/agent-cli/dashboard/dashboard_server.js +340 -0
- package/lib/agent-cli/dashboard/index.html +538 -0
- package/lib/agent-cli/lib/audit.js +2 -2
- package/lib/agent-cli/lib/auto-learn.js +8 -8
- package/lib/agent-cli/lib/eslint-fix.js +1 -1
- package/lib/agent-cli/lib/fix.js +5 -5
- package/lib/agent-cli/lib/hooks/install-hooks.js +4 -4
- package/lib/agent-cli/lib/hooks/lint-learn.js +4 -4
- package/lib/agent-cli/lib/learn.js +10 -10
- package/lib/agent-cli/lib/recall.js +1 -1
- package/lib/agent-cli/lib/settings.js +24 -0
- package/lib/agent-cli/lib/skill-learn.js +2 -2
- package/lib/agent-cli/lib/stats.js +3 -3
- package/lib/agent-cli/lib/ui/dashboard-ui.js +103 -4
- package/lib/agent-cli/lib/ui/index.js +36 -6
- package/lib/agent-cli/lib/watcher.js +2 -2
- package/lib/agent-cli/package.json +4 -4
- package/lib/agent-cli/scripts/adaptive_engine.js +381 -0
- package/lib/agent-cli/scripts/dashboard_server.js +224 -0
- package/lib/agent-cli/scripts/error_sensor.js +565 -0
- package/lib/agent-cli/scripts/learn_from_failure.js +225 -0
- package/lib/agent-cli/scripts/pattern_analyzer.js +781 -0
- package/lib/agent-cli/scripts/pre_execution_check.js +623 -0
- package/lib/agent-cli/scripts/rule_sharing.js +374 -0
- package/lib/agent-cli/scripts/skill_injector.js +387 -0
- package/lib/agent-cli/scripts/success_sensor.js +500 -0
- package/lib/agent-cli/scripts/user_correction_sensor.js +426 -0
- package/lib/agent-cli/services/auto-learn-service.js +247 -0
- package/lib/agent-cli/src/MIGRATION.md +418 -0
- package/lib/agent-cli/src/README.md +367 -0
- package/lib/agent-cli/src/core/evolution/evolution-signal.js +42 -0
- package/lib/agent-cli/src/core/evolution/index.js +17 -0
- package/lib/agent-cli/src/core/evolution/review-gate.js +40 -0
- package/lib/agent-cli/src/core/evolution/signal-detector.js +137 -0
- package/lib/agent-cli/src/core/evolution/signal-queue.js +79 -0
- package/lib/agent-cli/src/core/evolution/threshold-checker.js +79 -0
- package/lib/agent-cli/src/core/index.js +15 -0
- package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +282 -0
- package/lib/agent-cli/src/core/learning/index.js +12 -0
- package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +83 -0
- package/lib/agent-cli/src/core/scanning/index.js +14 -0
- package/lib/agent-cli/src/data/index.js +13 -0
- package/lib/agent-cli/src/data/repositories/index.js +8 -0
- package/lib/agent-cli/src/data/repositories/lesson-repository.js +130 -0
- package/lib/agent-cli/src/data/repositories/signal-repository.js +119 -0
- package/lib/agent-cli/src/data/storage/index.js +8 -0
- package/lib/agent-cli/src/data/storage/json-storage.js +64 -0
- package/lib/agent-cli/src/data/storage/yaml-storage.js +66 -0
- package/lib/agent-cli/src/infrastructure/index.js +13 -0
- package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +232 -0
- package/lib/agent-cli/src/services/export-service.js +162 -0
- package/lib/agent-cli/src/services/index.js +13 -0
- package/lib/agent-cli/src/services/learning-service.js +99 -0
- package/lib/agent-cli/types/index.d.ts +343 -0
- package/lib/agent-cli/utils/benchmark.js +269 -0
- package/lib/agent-cli/utils/logger.js +303 -0
- package/lib/agent-cli/utils/ml_patterns.js +300 -0
- package/lib/agent-cli/utils/recovery.js +312 -0
- package/lib/agent-cli/utils/telemetry.js +290 -0
- package/lib/agentskillskit-cli/ag-smart.js +15 -15
- package/lib/agentskillskit-cli/package.json +3 -3
- package/package.json +12 -6
- package/lib/agent-cli/lib/auto_preview.py +0 -148
- package/lib/agent-cli/lib/checklist.py +0 -222
- package/lib/agent-cli/lib/session_manager.py +0 -120
- package/lib/agent-cli/lib/verify_all.py +0 -327
- /package/bin/{cli.js → kit.js} +0 -0
package/README.md
CHANGED
|
@@ -1,149 +1,222 @@
|
|
|
1
|
-
#
|
|
1
|
+
# add-skill-kit
|
|
2
2
|
|
|
3
|
-
> **
|
|
3
|
+
> **CLI installer for Agent Skill Kit - FAANG-grade AI skills, workflows, and agents**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/add-skill-kit)
|
|
6
|
+
[](https://www.npmjs.com/package/add-skill-kit)
|
|
7
|
+
[](https://github.com/agentskillkit/add-skill-kit)
|
|
7
8
|
[](LICENSE)
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
### ⚡ Từ 0 → Production-Ready Trong 30 Giây
|
|
12
|
+
## ⚡ Installation
|
|
14
13
|
|
|
15
14
|
```bash
|
|
16
15
|
npx -y add-skill-kit agentskillkit/agent-skills
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
**
|
|
20
|
-
- 40+ skills chuyên môn
|
|
21
|
-
- 20 specialist agents
|
|
22
|
-
- 11 workflows có sẵn
|
|
23
|
-
- **✅ Agent CLI (`npx agent`) đã sẵn sàng**
|
|
18
|
+
**That's it!** One command installs everything:
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
| Component | Count | Description |
|
|
21
|
+
|-----------|-------|-------------|
|
|
22
|
+
| **Skills** | 49 | FAANG-grade coding skills |
|
|
23
|
+
| **Workflows** | 26 | `/think`, `/build`, `/autopilot`, etc. |
|
|
24
|
+
| **Agents** | 25 | Specialist AI agents |
|
|
25
|
+
| **Rules** | GEMINI.md | AI behavior configuration |
|
|
26
|
+
| **Scripts** | 25 | JavaScript automation scripts |
|
|
27
|
+
| **Commands** | `kit` | CLI management tool |
|
|
28
|
+
| **Commands** | `agent` | Interactive learning (optional) |
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
- ❌ Tìm kiếm prompts tốt trên internet
|
|
29
|
-
- ❌ Copy-paste vào từng project
|
|
30
|
-
- ❌ Maintain nhiều phiên bản khác nhau
|
|
30
|
+
---
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
- ✅ **1 source of truth** - Cập nhật trung tâm, mọi project đều nhận
|
|
34
|
-
- ✅ **Symlink install** - Không duplicate files
|
|
35
|
-
- ✅ **Version control** - Rollback bất cứ lúc nào
|
|
32
|
+
## 🎯 What This CLI Does
|
|
36
33
|
|
|
37
|
-
###
|
|
34
|
+
### 1. Fetches Skills from GitHub
|
|
38
35
|
|
|
39
36
|
```bash
|
|
40
|
-
#
|
|
41
|
-
npx
|
|
37
|
+
# Install from any GitHub repo
|
|
38
|
+
npx -y add-skill-kit <owner>/<repo>
|
|
39
|
+
|
|
40
|
+
# Examples:
|
|
41
|
+
npx -y add-skill-kit agentskillkit/agent-skills # Official skills
|
|
42
|
+
npx -y add-skill-kit myteam/company-skills # Custom skills
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Interactive Installation
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
┌───────────────────────────────────────────┐
|
|
49
|
+
│ 🛠️ Agent Skill Kit Installer │
|
|
50
|
+
├───────────────────────────────────────────┤
|
|
51
|
+
│ ◆ Select skills to install │
|
|
52
|
+
│ ◆ Choose install scope │
|
|
53
|
+
│ ◆ Configure AutoLearn (optional) │
|
|
54
|
+
│ ◆ Auto-install dependencies │
|
|
55
|
+
└───────────────────────────────────────────┘
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. Creates Ready-to-Use Structure
|
|
42
59
|
|
|
43
|
-
# Từ nay AI sẽ nhớ mãi và không lặp lại
|
|
44
60
|
```
|
|
61
|
+
your-project/
|
|
62
|
+
├── .agent/
|
|
63
|
+
│ ├── GEMINI.md # AI Rules
|
|
64
|
+
│ ├── skills/ # 49 Skills
|
|
65
|
+
│ ├── workflows/ # 26 Workflows
|
|
66
|
+
│ ├── agents/ # 25 Agents
|
|
67
|
+
│ ├── knowledge/ # Learning memory
|
|
68
|
+
│ ├── config/ # Configuration
|
|
69
|
+
│ ├── scripts-js/ # Automation
|
|
70
|
+
│ └── metrics/ # Tracking
|
|
71
|
+
│
|
|
72
|
+
├── kit.cmd / kit # CLI wrapper
|
|
73
|
+
└── agent.cmd / agent # AutoLearn (optional)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 🔧 CLI Options
|
|
79
|
+
|
|
80
|
+
### Install Scope
|
|
81
|
+
|
|
82
|
+
| Option | Location | Best For |
|
|
83
|
+
|--------|----------|----------|
|
|
84
|
+
| **Project** | `.agent/` in current project | Single project |
|
|
85
|
+
| **Global** | `~/.gemini/antigravity/` | All projects |
|
|
86
|
+
|
|
87
|
+
### AutoLearn (Optional)
|
|
88
|
+
|
|
89
|
+
When prompted "Install AutoLearn?":
|
|
90
|
+
|
|
91
|
+
| Choice | Effect |
|
|
92
|
+
|--------|--------|
|
|
93
|
+
| **Yes** | Installs `agent` command for interactive learning |
|
|
94
|
+
| **No** | Core functionality works perfectly, just no `agent` CLI |
|
|
95
|
+
|
|
96
|
+
> **Note:** Choosing "No" does NOT affect workflows, skills, or agents.
|
|
45
97
|
|
|
46
98
|
---
|
|
47
99
|
|
|
48
|
-
##
|
|
100
|
+
## 📦 Commands After Installation
|
|
49
101
|
|
|
50
|
-
###
|
|
102
|
+
### `kit` Command (Always Available)
|
|
51
103
|
|
|
52
104
|
```bash
|
|
53
|
-
#
|
|
54
|
-
|
|
105
|
+
kit list # List all installed skills
|
|
106
|
+
kit validate # Validate skill structure
|
|
107
|
+
kit info <skill> # Show skill details
|
|
108
|
+
kit doctor # Check system health
|
|
109
|
+
kit cache status # View cache usage
|
|
110
|
+
kit cache clear # Clear cache
|
|
111
|
+
```
|
|
55
112
|
|
|
56
|
-
|
|
57
|
-
|
|
113
|
+
### `agent` Command (If AutoLearn Installed)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
agent # Launch dashboard
|
|
117
|
+
agent learn # Teach patterns
|
|
118
|
+
agent recall # Scan violations
|
|
119
|
+
agent stats # View statistics
|
|
120
|
+
agent watch # Real-time monitor
|
|
58
121
|
```
|
|
59
122
|
|
|
60
|
-
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 🚀 Usage Examples
|
|
126
|
+
|
|
127
|
+
### Install Official Skills
|
|
61
128
|
|
|
62
129
|
```bash
|
|
63
|
-
|
|
64
|
-
|
|
130
|
+
npx -y add-skill-kit agentskillkit/agent-skills
|
|
131
|
+
```
|
|
65
132
|
|
|
66
|
-
|
|
67
|
-
add-skill-kit update
|
|
133
|
+
### Install Specific Skill
|
|
68
134
|
|
|
69
|
-
|
|
70
|
-
add-skill-kit
|
|
135
|
+
```bash
|
|
136
|
+
npx -y add-skill-kit agentskillkit/agent-skills/react-architect
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Install to Global Location
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npx -y add-skill-kit agentskillkit/agent-skills --global
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Force Reinstall
|
|
71
146
|
|
|
72
|
-
|
|
73
|
-
add-skill-kit
|
|
147
|
+
```bash
|
|
148
|
+
npx -y add-skill-kit agentskillkit/agent-skills --force
|
|
74
149
|
```
|
|
75
150
|
|
|
76
151
|
---
|
|
77
152
|
|
|
78
|
-
##
|
|
153
|
+
## 🗂️ What Gets Installed
|
|
79
154
|
|
|
80
|
-
|
|
81
|
-
|---------|---------------|---------------------|
|
|
82
|
-
| **Install time** | 30 giây | 30+ phút |
|
|
83
|
-
| **Cập nhật** | 1 lệnh | Manual mỗi file |
|
|
84
|
-
| **Consistency** | 100% đồng bộ | Dễ sai lệch |
|
|
85
|
-
| **Rollback** | ✅ Built-in | ❌ Manual backup |
|
|
86
|
-
| **Integrity check** | ✅ Merkle hash | ❌ Không có |
|
|
87
|
-
| **Self-learning** | ✅ Knowledge base | ❌ Không có |
|
|
155
|
+
### Complete Structure
|
|
88
156
|
|
|
89
|
-
|
|
157
|
+
```
|
|
158
|
+
.agent/
|
|
159
|
+
├── GEMINI.md # Supreme AI Rules
|
|
160
|
+
├── ARCHITECTURE.md # System Overview
|
|
161
|
+
├── CONTINUOUS_EXECUTION_POLICY.md # Autopilot Rules
|
|
162
|
+
├── WORKFLOW_CHAINS.md # Workflow Patterns
|
|
163
|
+
│
|
|
164
|
+
├── skills/ # 49 Skills
|
|
165
|
+
│ ├── auto-learner/
|
|
166
|
+
│ ├── react-architect/
|
|
167
|
+
│ ├── typescript-expert/
|
|
168
|
+
│ ├── debug-pro/
|
|
169
|
+
│ ├── studio/
|
|
170
|
+
│ └── ... (44 more)
|
|
171
|
+
│
|
|
172
|
+
├── workflows/ # 26 Workflows
|
|
173
|
+
│ ├── think.md
|
|
174
|
+
│ ├── build.md
|
|
175
|
+
│ ├── autopilot.md
|
|
176
|
+
│ └── ... (23 more)
|
|
177
|
+
│
|
|
178
|
+
├── agents/ # 25 Agents
|
|
179
|
+
│ ├── frontend-specialist.md
|
|
180
|
+
│ ├── backend-specialist.md
|
|
181
|
+
│ └── ... (23 more)
|
|
182
|
+
│
|
|
183
|
+
├── knowledge/ # Learning Memory
|
|
184
|
+
│ └── lessons-learned.yaml
|
|
185
|
+
│
|
|
186
|
+
├── config/ # Configuration
|
|
187
|
+
├── scripts-js/ # 25 JS Scripts
|
|
188
|
+
└── metrics/ # Performance
|
|
189
|
+
```
|
|
90
190
|
|
|
91
|
-
|
|
191
|
+
### Dependencies Auto-Installed
|
|
92
192
|
|
|
93
|
-
|
|
193
|
+
```bash
|
|
194
|
+
npm install # Node.js dependencies
|
|
195
|
+
```
|
|
94
196
|
|
|
95
|
-
|
|
96
|
-
|---------|-----------|
|
|
97
|
-
| `install` / `add` / `i` | Cài đặt skills từ GitHub |
|
|
98
|
-
| `uninstall` / `remove` / `rm` | Gỡ cài đặt |
|
|
99
|
-
| `update` | Cập nhật skills |
|
|
100
|
-
| `list` / `ls` | Liệt kê skills |
|
|
101
|
-
| `verify` | Kiểm tra integrity |
|
|
102
|
-
| `doctor` | Health check |
|
|
103
|
-
| `validate` / `check` | Validate spec |
|
|
104
|
-
| `analyze` | Phân tích skill |
|
|
105
|
-
| `info` / `show` | Thông tin skill |
|
|
106
|
-
| `lock` | Lock file |
|
|
107
|
-
| `cache` | Quản lý cache |
|
|
197
|
+
---
|
|
108
198
|
|
|
109
|
-
|
|
199
|
+
## 🔗 Related Packages
|
|
110
200
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
- **Merkle verification** - Đảm bảo integrity
|
|
201
|
+
| Package | Purpose |
|
|
202
|
+
|---------|---------|
|
|
203
|
+
| [agent-skills](https://github.com/agentskillkit/agent-skills) | Main skills repository |
|
|
204
|
+
| [add-skill-kit](https://www.npmjs.com/package/add-skill-kit) | This CLI installer |
|
|
116
205
|
|
|
117
|
-
|
|
206
|
+
---
|
|
118
207
|
|
|
119
|
-
|
|
208
|
+
## 📈 Version History
|
|
120
209
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### ⚡ 11 Slash Commands Có Sẵn
|
|
134
|
-
| Command | Chức năng |
|
|
135
|
-
|---------|-----------|
|
|
136
|
-
| `/brainstorm` | Khám phá options trước khi code |
|
|
137
|
-
| `/create` | Tạo features/apps mới |
|
|
138
|
-
| `/debug` | Debug có hệ thống |
|
|
139
|
-
| `/deploy` | Deploy production |
|
|
140
|
-
| `/enhance` | Thêm/cập nhật features |
|
|
141
|
-
| `/orchestrate` | Điều phối multi-agents |
|
|
142
|
-
| `/plan` | Lập kế hoạch task |
|
|
143
|
-
| `/preview` | Quản lý dev server |
|
|
144
|
-
| `/status` | Xem tiến độ project |
|
|
145
|
-
| `/test` | Tạo và chạy tests |
|
|
146
|
-
| `/ui-ux-pro-max` | Thiết kế UI chuyên sâu |
|
|
210
|
+
**v3.2.5 (Current)**
|
|
211
|
+
- ✅ 100% JavaScript - No Python required
|
|
212
|
+
- ✅ AutoLearn made optional
|
|
213
|
+
- ✅ Complete installation (config, scripts-js, metrics, policy docs)
|
|
214
|
+
- ✅ Improved error messages
|
|
215
|
+
- ✅ Wrapper scripts for `kit` and `agent`
|
|
216
|
+
|
|
217
|
+
**v3.2.0**
|
|
218
|
+
- Migrated all scripts to JavaScript
|
|
219
|
+
- Added `kit` CLI command
|
|
147
220
|
|
|
148
221
|
---
|
|
149
222
|
|
|
@@ -157,34 +230,21 @@ cd add-skill-kit
|
|
|
157
230
|
# Install dependencies
|
|
158
231
|
npm install
|
|
159
232
|
|
|
160
|
-
# Run
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
# Run linting
|
|
164
|
-
npm run lint
|
|
233
|
+
# Run locally
|
|
234
|
+
node bin/kit.js install agentskillkit/agent-skills
|
|
165
235
|
```
|
|
166
236
|
|
|
167
237
|
---
|
|
168
238
|
|
|
169
|
-
##
|
|
170
|
-
|
|
171
|
-
- Node.js 18+
|
|
172
|
-
- Git (để clone repositories)
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## 🔗 Links
|
|
239
|
+
## 📄 License
|
|
177
240
|
|
|
178
|
-
-
|
|
179
|
-
- [NPM Package](https://www.npmjs.com/package/add-skill-kit)
|
|
180
|
-
- [Issues](https://github.com/agentskillkit/add-skill-kit/issues)
|
|
241
|
+
MIT - Free for all projects.
|
|
181
242
|
|
|
182
243
|
---
|
|
183
244
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
MIT - Sử dụng tự do.
|
|
245
|
+
**⚡ add-skill-kit v3.2.5**
|
|
246
|
+
*One command. Complete AI setup.*
|
|
187
247
|
|
|
188
248
|
---
|
|
189
249
|
|
|
190
|
-
|
|
250
|
+
**[GitHub](https://github.com/agentskillkit/add-skill-kit) • [npm](https://www.npmjs.com/package/add-skill-kit) • [Issues](https://github.com/agentskillkit/add-skill-kit/issues)**
|
package/bin/lib/commands/help.js
CHANGED
|
@@ -12,10 +12,6 @@ export async function run() {
|
|
|
12
12
|
let running = true;
|
|
13
13
|
|
|
14
14
|
while (running) {
|
|
15
|
-
stepLine();
|
|
16
|
-
step(c.bold("kit") + c.dim(` v${VERSION}`));
|
|
17
|
-
step(c.dim("What would you like to know?"));
|
|
18
|
-
stepLine();
|
|
19
15
|
|
|
20
16
|
const choice = await select({
|
|
21
17
|
message: "Select a topic",
|
|
@@ -523,6 +523,58 @@ export async function run(spec) {
|
|
|
523
523
|
knowledgeInstalled = true;
|
|
524
524
|
}
|
|
525
525
|
|
|
526
|
+
// Install config/ if it exists (required for skill configuration)
|
|
527
|
+
const configDir = path.join(baseAgentDir, "config");
|
|
528
|
+
const targetConfigDir = path.join(WORKSPACE, "..", "config");
|
|
529
|
+
let configInstalled = false;
|
|
530
|
+
|
|
531
|
+
if (fs.existsSync(configDir) && !fs.existsSync(targetConfigDir)) {
|
|
532
|
+
fs.cpSync(configDir, targetConfigDir, { recursive: true });
|
|
533
|
+
step("Installed config/");
|
|
534
|
+
configInstalled = true;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// Install scripts-js/ if it exists (required for skill operations)
|
|
538
|
+
const scriptsJsDir = path.join(baseAgentDir, "scripts-js");
|
|
539
|
+
const targetScriptsJsDir = path.join(WORKSPACE, "..", "scripts-js");
|
|
540
|
+
let scriptsJsInstalled = false;
|
|
541
|
+
|
|
542
|
+
if (fs.existsSync(scriptsJsDir) && !fs.existsSync(targetScriptsJsDir)) {
|
|
543
|
+
fs.cpSync(scriptsJsDir, targetScriptsJsDir, { recursive: true });
|
|
544
|
+
step("Installed scripts-js/");
|
|
545
|
+
scriptsJsInstalled = true;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// Install metrics/ if it exists (for agent performance tracking)
|
|
549
|
+
const metricsDir = path.join(baseAgentDir, "metrics");
|
|
550
|
+
const targetMetricsDir = path.join(WORKSPACE, "..", "metrics");
|
|
551
|
+
let metricsInstalled = false;
|
|
552
|
+
|
|
553
|
+
if (fs.existsSync(metricsDir) && !fs.existsSync(targetMetricsDir)) {
|
|
554
|
+
fs.cpSync(metricsDir, targetMetricsDir, { recursive: true });
|
|
555
|
+
step("Installed metrics/");
|
|
556
|
+
metricsInstalled = true;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
// Install additional policy documents
|
|
560
|
+
const policyDocs = [
|
|
561
|
+
"CONTINUOUS_EXECUTION_POLICY.md",
|
|
562
|
+
"WORKFLOW_CHAINS.md"
|
|
563
|
+
];
|
|
564
|
+
let policyDocsInstalled = 0;
|
|
565
|
+
|
|
566
|
+
for (const doc of policyDocs) {
|
|
567
|
+
const docSrc = path.join(baseAgentDir, doc);
|
|
568
|
+
const docDest = path.join(WORKSPACE, "..", doc);
|
|
569
|
+
if (fs.existsSync(docSrc) && !fs.existsSync(docDest)) {
|
|
570
|
+
fs.copyFileSync(docSrc, docDest);
|
|
571
|
+
policyDocsInstalled++;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (policyDocsInstalled > 0) {
|
|
575
|
+
step(`Installed ${policyDocsInstalled} policy docs`);
|
|
576
|
+
}
|
|
577
|
+
|
|
526
578
|
// Install rules if they exist
|
|
527
579
|
const rulesDir = path.join(baseAgentDir, "rules");
|
|
528
580
|
const targetRulesDir = path.join(WORKSPACE, "..", "rules");
|
|
@@ -630,17 +682,37 @@ export async function run(spec) {
|
|
|
630
682
|
|
|
631
683
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
632
684
|
|
|
685
|
+
// Ask user about AutoLearn installation
|
|
686
|
+
stepLine();
|
|
687
|
+
const installAutoLearn = await confirm({
|
|
688
|
+
message: "Install AutoLearn (enables 'agent' command for learning & self-improvement)?",
|
|
689
|
+
initialValue: true
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
if (isCancel(installAutoLearn)) {
|
|
693
|
+
cancel("Installation cancelled");
|
|
694
|
+
process.exit(0);
|
|
695
|
+
}
|
|
696
|
+
|
|
633
697
|
// Install CLI package
|
|
634
698
|
stepLine();
|
|
635
699
|
const cliSpinner = spinner();
|
|
636
|
-
const cliPackage = "
|
|
700
|
+
const cliPackage = "add-skill-kit";
|
|
637
701
|
|
|
638
702
|
if (isGlobal) {
|
|
639
|
-
|
|
703
|
+
if (installAutoLearn) {
|
|
704
|
+
cliSpinner.start(`Installing CLI globally (${cliPackage})`);
|
|
705
|
+
} else {
|
|
706
|
+
cliSpinner.start(`Installing kit CLI globally (${cliPackage})`);
|
|
707
|
+
}
|
|
640
708
|
try {
|
|
641
709
|
await execAsync(`npm install -g ${cliPackage}`, { timeout: 120000 });
|
|
642
|
-
cliSpinner.stop("
|
|
643
|
-
|
|
710
|
+
cliSpinner.stop("CLI installed globally");
|
|
711
|
+
if (installAutoLearn) {
|
|
712
|
+
step(c.dim("Commands: agent, kit"));
|
|
713
|
+
} else {
|
|
714
|
+
step(c.dim("Command: kit"));
|
|
715
|
+
}
|
|
644
716
|
} catch (e) {
|
|
645
717
|
cliSpinner.stop(c.yellow("Global CLI installation failed"));
|
|
646
718
|
step(c.dim(`Try running manually: npm i -g ${cliPackage}`));
|
|
@@ -649,7 +721,7 @@ export async function run(spec) {
|
|
|
649
721
|
cliSpinner.start(`Installing Agent CLI locally (${cliPackage})`);
|
|
650
722
|
try {
|
|
651
723
|
await execAsync(`npm install -D ${cliPackage}`, { timeout: 120000 });
|
|
652
|
-
cliSpinner.stop("
|
|
724
|
+
cliSpinner.stop("CLI installed locally");
|
|
653
725
|
|
|
654
726
|
// Add npm scripts to package.json
|
|
655
727
|
try {
|
|
@@ -658,25 +730,73 @@ export async function run(spec) {
|
|
|
658
730
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
659
731
|
pkg.scripts = pkg.scripts || {};
|
|
660
732
|
|
|
661
|
-
//
|
|
662
|
-
if (!pkg.scripts.
|
|
733
|
+
// Always add kit script
|
|
734
|
+
if (!pkg.scripts.kit) {
|
|
735
|
+
pkg.scripts.kit = "kit";
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
// Add agent script only if AutoLearn enabled
|
|
739
|
+
if (installAutoLearn && !pkg.scripts.agent) {
|
|
663
740
|
pkg.scripts.agent = "agent";
|
|
664
741
|
}
|
|
665
742
|
|
|
666
743
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
667
|
-
|
|
744
|
+
if (installAutoLearn) {
|
|
745
|
+
step(c.green("✓ Added npm scripts: 'agent', 'kit'"));
|
|
746
|
+
} else {
|
|
747
|
+
step(c.green("✓ Added npm script: 'kit'"));
|
|
748
|
+
}
|
|
668
749
|
}
|
|
669
750
|
} catch (scriptErr) {
|
|
670
751
|
step(c.yellow("⚠ Could not add npm scripts automatically"));
|
|
671
752
|
}
|
|
672
753
|
|
|
673
|
-
|
|
754
|
+
// Create wrapper scripts for direct command access (Windows + Unix)
|
|
755
|
+
try {
|
|
756
|
+
const projectRoot = process.cwd();
|
|
757
|
+
|
|
758
|
+
// Always create kit wrappers
|
|
759
|
+
const kitCmd = `@echo off\nnode "%~dp0node_modules\\add-skill-kit\\bin\\kit.js" %*`;
|
|
760
|
+
const kitSh = `#!/bin/sh\nnode "$(dirname "$0")/node_modules/add-skill-kit/bin/kit.js" "$@"`;
|
|
761
|
+
fs.writeFileSync(path.join(projectRoot, "kit.cmd"), kitCmd);
|
|
762
|
+
fs.writeFileSync(path.join(projectRoot, "kit"), kitSh, { mode: 0o755 });
|
|
763
|
+
|
|
764
|
+
if (installAutoLearn) {
|
|
765
|
+
// Create agent wrappers only if AutoLearn enabled
|
|
766
|
+
const agentCmd = `@echo off\nnode "%~dp0node_modules\\add-skill-kit\\lib\\agent-cli\\bin\\agent.js" %*`;
|
|
767
|
+
const agentSh = `#!/bin/sh\nnode "$(dirname "$0")/node_modules/add-skill-kit/lib/agent-cli/bin/agent.js" "$@"`;
|
|
768
|
+
fs.writeFileSync(path.join(projectRoot, "agent.cmd"), agentCmd);
|
|
769
|
+
fs.writeFileSync(path.join(projectRoot, "agent"), agentSh, { mode: 0o755 });
|
|
770
|
+
|
|
771
|
+
step(c.green("✓ Created wrapper scripts: agent, kit"));
|
|
772
|
+
step(c.dim("Run directly: ./agent or ./kit (Unix) | agent or kit (Windows)"));
|
|
773
|
+
} else {
|
|
774
|
+
step(c.green("✓ Created wrapper script: kit"));
|
|
775
|
+
step(c.dim("Run directly: ./kit (Unix) | kit (Windows)"));
|
|
776
|
+
}
|
|
777
|
+
} catch (wrapperErr) {
|
|
778
|
+
step(c.dim("Run: npx kit"));
|
|
779
|
+
}
|
|
674
780
|
} catch (e) {
|
|
675
781
|
cliSpinner.stop(c.yellow("Local CLI installation skipped"));
|
|
676
782
|
step(c.dim(`Run manually: npm i -D ${cliPackage}`));
|
|
677
783
|
}
|
|
678
784
|
}
|
|
679
785
|
|
|
786
|
+
// Run npm install to ensure all skill dependencies are available
|
|
787
|
+
stepLine();
|
|
788
|
+
const depsSpinner = spinner();
|
|
789
|
+
depsSpinner.start("Installing skill dependencies (csv-parse, etc.)");
|
|
790
|
+
try {
|
|
791
|
+
await execAsync("npm install", { timeout: 120000 });
|
|
792
|
+
depsSpinner.stop("Skill dependencies installed");
|
|
793
|
+
} catch (e) {
|
|
794
|
+
depsSpinner.stop(c.yellow("Dependencies installation skipped"));
|
|
795
|
+
step(c.dim("Run manually: npm install"));
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// Python dependencies no longer needed - all scripts migrated to JS
|
|
799
|
+
|
|
680
800
|
stepLine();
|
|
681
801
|
console.log(` ${c.cyan("Done!")}`);
|
|
682
802
|
console.log();
|
package/bin/lib/ui.js
CHANGED
|
@@ -177,7 +177,7 @@ export function brandedIntro(version, status = "") {
|
|
|
177
177
|
// Last line: gradient ASCII + dim version (aligned at bottom)
|
|
178
178
|
const lastLine = bannerLines[bannerLines.length - 1];
|
|
179
179
|
console.log(pikaGradient(lastLine) + ` ${c.dim(`v${version}`)}`);
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
|
|
182
182
|
if (status) {
|
|
183
183
|
console.log(`${c.dim(status)}`);
|