create-agent-skills 1.0.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 +95 -0
- package/SKILL_GUIDELINES.md +339 -0
- package/bin/cli.js +133 -0
- package/lib/index.js +5 -0
- package/lib/installer.js +319 -0
- package/package.json +46 -0
- package/skills/code-review/SKILL.md +126 -0
- package/skills/create-agent-skill/SKILL.md +214 -0
- package/skills/create-agent-skill/examples/advanced-skill.md +88 -0
- package/skills/create-agent-skill/examples/simple-skill.md +27 -0
- package/skills/create-agent-skill/resources/SKILL_GUIDELINES.md +339 -0
- package/skills/documentation/SKILL.md +222 -0
- package/skills/git-commit/SKILL.md +211 -0
- package/skills/git-pr/SKILL.md +208 -0
- package/skills/git-pr/resources/pr-template.md +35 -0
- package/skills/git-review/SKILL.md +218 -0
- package/skills/git-review/resources/review-checklist.md +50 -0
- package/skills/tailwindcss-v4/SKILL.md +270 -0
- package/skills/tailwindcss-v4/examples/custom-theme.css +157 -0
- package/skills/tailwindcss-v4/examples/nextjs-setup.md +137 -0
- package/skills/tailwindcss-v4/examples/vite-setup.md +95 -0
- package/skills/tauri-v2/SKILL.md +647 -0
- package/skills/tauri-v2/examples/project-structure.md +77 -0
- package/skills/tauri-v2/examples/react-frontend/hooks/tauri-hooks.md +217 -0
- package/skills/tauri-v2/examples/react-frontend/mvvm-structure.md +229 -0
- package/skills/tauri-v2/examples/react-frontend/stores/zustand-patterns.md +204 -0
- package/skills/tauri-v2/examples/rust-backend/commands.md +93 -0
- package/skills/tauri-v2/examples/rust-backend/error-handling.md +84 -0
- package/skills/tauri-v2/examples/rust-backend/state.md +104 -0
- package/skills/tauri-v2/resources/tauri-config-example.json +82 -0
- package/skills/testing/SKILL.md +188 -0
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Agent Skills CLI
|
|
2
|
+
|
|
3
|
+
CLI tool to install Agent Skills for AI coding assistants.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx create-agent-skills
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install globally:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g create-agent-skills
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
Run the CLI and follow the interactive prompts:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx create-agent-skills
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Options
|
|
26
|
+
|
|
27
|
+
1. **Install Location**
|
|
28
|
+
- `Workspace` - `.agent/skills/` (project-specific)
|
|
29
|
+
- `Global` - `~/.gemini/antigravity/skills/` (all projects)
|
|
30
|
+
|
|
31
|
+
2. **Skill Selection**
|
|
32
|
+
- Use `Space` to toggle skills
|
|
33
|
+
- Use `a` to toggle all
|
|
34
|
+
- Use `i` to invert selection
|
|
35
|
+
- Press `Enter` to confirm
|
|
36
|
+
|
|
37
|
+
## Available Skills
|
|
38
|
+
|
|
39
|
+
| Skill | Description |
|
|
40
|
+
|-------|-------------|
|
|
41
|
+
| `code-review` | Reviews code for bugs, style, and security issues |
|
|
42
|
+
| `create-agent-skill` | Helps create new skills following guidelines |
|
|
43
|
+
| `documentation` | Creates clear READMEs, API docs, and comments |
|
|
44
|
+
| `testing` | Helps write unit, integration, and E2E tests |
|
|
45
|
+
|
|
46
|
+
## Creating New Skills
|
|
47
|
+
|
|
48
|
+
See [SKILL_GUIDELINES.md](./SKILL_GUIDELINES.md) for the complete guide.
|
|
49
|
+
|
|
50
|
+
### Quick Start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
mkdir -p .agent/skills/my-skill
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Create `SKILL.md` with:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
---
|
|
60
|
+
name: my-skill
|
|
61
|
+
description: What this skill does. Use when...
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
# My Skill
|
|
65
|
+
|
|
66
|
+
Instructions for the agent...
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Folder Structure
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
.agent/skills/<skill-name>/
|
|
73
|
+
├── SKILL.md # Main instructions (REQUIRED)
|
|
74
|
+
├── scripts/ # Helper scripts (optional)
|
|
75
|
+
├── examples/ # Reference implementations (optional)
|
|
76
|
+
└── resources/ # Templates and other assets (optional)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Clone the repo
|
|
83
|
+
git clone https://github.com/Nghi-NV/create-agent-skills.git
|
|
84
|
+
cd create-agent-skills
|
|
85
|
+
|
|
86
|
+
# Install dependencies
|
|
87
|
+
npm install
|
|
88
|
+
|
|
89
|
+
# Run locally
|
|
90
|
+
node bin/cli.js
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
MIT
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
# Agent Skills Guidelines
|
|
2
|
+
|
|
3
|
+
Standard guidelines for creating skills for AI Agents. All skills must follow these rules.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📁 Required Folder Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
.agent/skills/<skill-name>/
|
|
11
|
+
├── SKILL.md # Main instructions (REQUIRED)
|
|
12
|
+
├── scripts/ # Helper scripts (optional)
|
|
13
|
+
├── examples/ # Reference implementations (optional)
|
|
14
|
+
└── resources/ # Templates and other assets (optional)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Naming Rules
|
|
18
|
+
|
|
19
|
+
| Element | Rule | Example |
|
|
20
|
+
|---------|------|---------|
|
|
21
|
+
| Folder name | lowercase, hyphens | `code-review`, `unit-testing` |
|
|
22
|
+
| SKILL.md | MUST be uppercase | `SKILL.md` (not `skill.md`) |
|
|
23
|
+
| Scripts | lowercase, hyphens | `run-tests.sh`, `validate.js` |
|
|
24
|
+
|
|
25
|
+
### When to Use External Files
|
|
26
|
+
|
|
27
|
+
> [!TIP]
|
|
28
|
+
> If your SKILL.md becomes too long (>500 lines), split content into the appropriate folders and link to them.
|
|
29
|
+
|
|
30
|
+
**Use `examples/` folder when:**
|
|
31
|
+
- You have multiple code examples
|
|
32
|
+
- Examples are complete, runnable files
|
|
33
|
+
- Examples need syntax highlighting that's hard to read inline
|
|
34
|
+
|
|
35
|
+
**Use `scripts/` folder when:**
|
|
36
|
+
- You have helper scripts the agent should run
|
|
37
|
+
- Scripts are reusable utilities
|
|
38
|
+
|
|
39
|
+
**Use `resources/` folder when:**
|
|
40
|
+
- You have templates, config files, or other assets
|
|
41
|
+
- You have images or diagrams
|
|
42
|
+
|
|
43
|
+
#### Linking to External Files
|
|
44
|
+
|
|
45
|
+
In your SKILL.md, link to external files using relative paths:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## Examples
|
|
49
|
+
|
|
50
|
+
For complete examples, see:
|
|
51
|
+
- [Basic Usage](./examples/basic-usage.js) - Simple getting started example
|
|
52
|
+
- [Advanced Patterns](./examples/advanced-patterns.js) - Complex use cases
|
|
53
|
+
- [Error Handling](./examples/error-handling.js) - How to handle edge cases
|
|
54
|
+
|
|
55
|
+
## Scripts
|
|
56
|
+
|
|
57
|
+
Run the validation script:
|
|
58
|
+
\`\`\`bash
|
|
59
|
+
./scripts/validate.sh --help
|
|
60
|
+
\`\`\`
|
|
61
|
+
|
|
62
|
+
See [validate.sh](./scripts/validate.sh) for implementation details.
|
|
63
|
+
|
|
64
|
+
## Templates
|
|
65
|
+
|
|
66
|
+
Use the provided templates:
|
|
67
|
+
- [Component Template](./resources/component-template.tsx)
|
|
68
|
+
- [Test Template](./resources/test-template.spec.ts)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Example Folder Structure (Large Skill)
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
.agent/skills/react-components/
|
|
75
|
+
├── SKILL.md # Main instructions, links to examples
|
|
76
|
+
├── scripts/
|
|
77
|
+
│ ├── generate-component.sh # Script to scaffold components
|
|
78
|
+
│ └── validate-props.js # Prop validation utility
|
|
79
|
+
├── examples/
|
|
80
|
+
│ ├── basic-button.tsx # Simple button example
|
|
81
|
+
│ ├── form-with-validation.tsx # Form handling example
|
|
82
|
+
│ ├── data-fetching.tsx # API integration example
|
|
83
|
+
│ └── README.md # Examples index/overview
|
|
84
|
+
└── resources/
|
|
85
|
+
├── component-template.tsx # Starter template
|
|
86
|
+
├── test-template.spec.ts # Test file template
|
|
87
|
+
└── styles-template.module.css # CSS module template
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 📄 SKILL.md Format
|
|
93
|
+
|
|
94
|
+
### YAML Frontmatter (Required)
|
|
95
|
+
|
|
96
|
+
Every SKILL.md MUST start with YAML frontmatter:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
---
|
|
100
|
+
name: skill-name
|
|
101
|
+
description: Clear description of what this skill does. Use when you need to do X or Y.
|
|
102
|
+
---
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
| Field | Required | Description |
|
|
106
|
+
|-------|----------|-------------|
|
|
107
|
+
| `name` | No | Unique identifier (lowercase, hyphens). Defaults to folder name |
|
|
108
|
+
| `description` | **YES** | What the skill does and when to use it. Agent sees this first |
|
|
109
|
+
|
|
110
|
+
> [!IMPORTANT]
|
|
111
|
+
> **Description is the most important field!** The agent uses the description to decide whether to use the skill. Be clear and specific.
|
|
112
|
+
|
|
113
|
+
### Standard Content Structure
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
---
|
|
117
|
+
name: my-skill
|
|
118
|
+
description: Helps with a specific task. Use when you need to do X or Y.
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
# Skill Name
|
|
122
|
+
|
|
123
|
+
Brief overview of what this skill provides.
|
|
124
|
+
|
|
125
|
+
## When to Use This Skill
|
|
126
|
+
|
|
127
|
+
- Use this when...
|
|
128
|
+
- This is helpful for...
|
|
129
|
+
- Consider this skill if...
|
|
130
|
+
|
|
131
|
+
## Prerequisites
|
|
132
|
+
|
|
133
|
+
- Required tools/dependencies
|
|
134
|
+
- Environment setup needed
|
|
135
|
+
|
|
136
|
+
## How to Use
|
|
137
|
+
|
|
138
|
+
Step-by-step guidance, conventions, and patterns the agent should follow.
|
|
139
|
+
|
|
140
|
+
### Step 1: [Action Name]
|
|
141
|
+
|
|
142
|
+
Detailed instructions...
|
|
143
|
+
|
|
144
|
+
### Step 2: [Action Name]
|
|
145
|
+
|
|
146
|
+
Detailed instructions...
|
|
147
|
+
|
|
148
|
+
## Decision Tree
|
|
149
|
+
|
|
150
|
+
Use this section for complex skills with multiple paths:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Is X true?
|
|
154
|
+
├── YES → Do A
|
|
155
|
+
│ └── Then do B
|
|
156
|
+
└── NO → Do C
|
|
157
|
+
└── Then do D
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Examples
|
|
161
|
+
|
|
162
|
+
### Example 1: [Scenario]
|
|
163
|
+
|
|
164
|
+
\`\`\`bash
|
|
165
|
+
# Example command or code
|
|
166
|
+
\`\`\`
|
|
167
|
+
|
|
168
|
+
## Best Practices
|
|
169
|
+
|
|
170
|
+
- Practice 1
|
|
171
|
+
- Practice 2
|
|
172
|
+
|
|
173
|
+
## Common Pitfalls
|
|
174
|
+
|
|
175
|
+
- Pitfall 1: How to avoid
|
|
176
|
+
- Pitfall 2: How to avoid
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## ✅ Validation Checklist
|
|
182
|
+
|
|
183
|
+
Before publishing a skill, verify:
|
|
184
|
+
|
|
185
|
+
### Structure
|
|
186
|
+
- [ ] Folder name is lowercase with hyphens
|
|
187
|
+
- [ ] Has `SKILL.md` file (correctly capitalized)
|
|
188
|
+
- [ ] YAML frontmatter has `description`
|
|
189
|
+
|
|
190
|
+
### Content
|
|
191
|
+
- [ ] Description is clear and specific (not generic)
|
|
192
|
+
- [ ] Has "When to Use" section
|
|
193
|
+
- [ ] Has "How to Use" section with specific steps
|
|
194
|
+
- [ ] Examples are realistic and runnable
|
|
195
|
+
|
|
196
|
+
### Best Practices
|
|
197
|
+
- [ ] Skill focuses on one specific task
|
|
198
|
+
- [ ] No overlap with other skills
|
|
199
|
+
- [ ] Scripts have `--help` option
|
|
200
|
+
- [ ] Decision tree for complex logic
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## 🎯 Best Practices
|
|
205
|
+
|
|
206
|
+
### 1. Keep Skills Focused
|
|
207
|
+
|
|
208
|
+
```diff
|
|
209
|
+
- ❌ skill: "do-everything-for-project"
|
|
210
|
+
+ ✅ skill: "code-review"
|
|
211
|
+
+ ✅ skill: "unit-testing"
|
|
212
|
+
+ ✅ skill: "documentation"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 2. Write Clear Descriptions
|
|
216
|
+
|
|
217
|
+
```diff
|
|
218
|
+
- ❌ description: "Helps with code"
|
|
219
|
+
+ ✅ description: "Reviews code changes for bugs, style issues, and best practices. Use when reviewing PRs or checking code quality."
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### 3. Use Scripts as Black Boxes
|
|
223
|
+
|
|
224
|
+
Encourage the agent to run `script --help` instead of reading source code:
|
|
225
|
+
|
|
226
|
+
```markdown
|
|
227
|
+
## Available Scripts
|
|
228
|
+
|
|
229
|
+
Run `./scripts/validate.sh --help` to see all options.
|
|
230
|
+
Do NOT read the script source directly.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### 4. Include Decision Trees
|
|
234
|
+
|
|
235
|
+
For complex skills:
|
|
236
|
+
|
|
237
|
+
```markdown
|
|
238
|
+
## Decision Tree
|
|
239
|
+
|
|
240
|
+
What type of test?
|
|
241
|
+
├── Unit Test → Use `jest` with mocking
|
|
242
|
+
├── Integration Test → Use `supertest` for API
|
|
243
|
+
└── E2E Test → Use `playwright` or `cypress`
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 5. Provide Real Examples
|
|
247
|
+
|
|
248
|
+
```markdown
|
|
249
|
+
## Examples
|
|
250
|
+
|
|
251
|
+
### Reviewing a Pull Request
|
|
252
|
+
|
|
253
|
+
1. Check out the PR branch
|
|
254
|
+
2. Run linting: `npm run lint`
|
|
255
|
+
3. Run tests: `npm test`
|
|
256
|
+
4. Review changes file by file
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## 📝 Starter Template
|
|
262
|
+
|
|
263
|
+
Copy this template to start a new skill:
|
|
264
|
+
|
|
265
|
+
```markdown
|
|
266
|
+
---
|
|
267
|
+
name: my-new-skill
|
|
268
|
+
description: [Clear, specific description. Include keywords for discovery.]
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
# [Skill Name]
|
|
272
|
+
|
|
273
|
+
[1-2 sentence overview]
|
|
274
|
+
|
|
275
|
+
## When to Use This Skill
|
|
276
|
+
|
|
277
|
+
- Use when [specific situation 1]
|
|
278
|
+
- Use when [specific situation 2]
|
|
279
|
+
- NOT for [exclusion case]
|
|
280
|
+
|
|
281
|
+
## Prerequisites
|
|
282
|
+
|
|
283
|
+
- [Required tool/setup 1]
|
|
284
|
+
- [Required tool/setup 2]
|
|
285
|
+
|
|
286
|
+
## How to Use
|
|
287
|
+
|
|
288
|
+
### Step 1: [First Action]
|
|
289
|
+
|
|
290
|
+
[Detailed instructions]
|
|
291
|
+
|
|
292
|
+
### Step 2: [Second Action]
|
|
293
|
+
|
|
294
|
+
[Detailed instructions]
|
|
295
|
+
|
|
296
|
+
## Examples
|
|
297
|
+
|
|
298
|
+
### [Example Scenario]
|
|
299
|
+
|
|
300
|
+
\`\`\`bash
|
|
301
|
+
# Example commands
|
|
302
|
+
\`\`\`
|
|
303
|
+
|
|
304
|
+
## Best Practices
|
|
305
|
+
|
|
306
|
+
- [Practice 1]
|
|
307
|
+
- [Practice 2]
|
|
308
|
+
|
|
309
|
+
## Troubleshooting
|
|
310
|
+
|
|
311
|
+
| Issue | Solution |
|
|
312
|
+
|-------|----------|
|
|
313
|
+
| [Problem 1] | [Fix 1] |
|
|
314
|
+
| [Problem 2] | [Fix 2] |
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## 🗂️ Skill Locations
|
|
320
|
+
|
|
321
|
+
| Location | Scope | Use Case |
|
|
322
|
+
|----------|-------|----------|
|
|
323
|
+
| `<workspace>/.agent/skills/` | Workspace-specific | Team workflows, project conventions |
|
|
324
|
+
| `~/.gemini/antigravity/skills/` | Global (all workspaces) | Personal utilities, general tools |
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 📚 Optional Sections
|
|
329
|
+
|
|
330
|
+
Add these sections when needed:
|
|
331
|
+
|
|
332
|
+
| Section | When to Include |
|
|
333
|
+
|---------|-----------------|
|
|
334
|
+
| `## Prerequisites` | When setup is required |
|
|
335
|
+
| `## Decision Tree` | When there are multiple paths/options |
|
|
336
|
+
| `## Scripts` | When skill has helper scripts |
|
|
337
|
+
| `## Configuration` | When there are config options |
|
|
338
|
+
| `## Troubleshooting` | When there are common issues |
|
|
339
|
+
| `## Related Skills` | When related to other skills |
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const inquirer = require('inquirer');
|
|
4
|
+
const chalk = require('chalk');
|
|
5
|
+
const ora = require('ora');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const fs = require('fs-extra');
|
|
8
|
+
const { getAvailableSkills, installSkills, getInstallPath } = require('../lib/installer');
|
|
9
|
+
|
|
10
|
+
const BANNER = `
|
|
11
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
12
|
+
║ ║
|
|
13
|
+
║ ${chalk.cyan.bold('🚀 Agent Skills Installer')} ║
|
|
14
|
+
║ ║
|
|
15
|
+
║ Install skills to extend your AI agent's capabilities ║
|
|
16
|
+
║ ║
|
|
17
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
async function main() {
|
|
21
|
+
console.log(BANNER);
|
|
22
|
+
|
|
23
|
+
const skills = getAvailableSkills();
|
|
24
|
+
|
|
25
|
+
if (skills.length === 0) {
|
|
26
|
+
console.log(chalk.yellow('⚠️ No skills available to install.'));
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Step 1: Choose installation location
|
|
31
|
+
const { installLocation } = await inquirer.prompt([
|
|
32
|
+
{
|
|
33
|
+
type: 'list',
|
|
34
|
+
name: 'installLocation',
|
|
35
|
+
message: 'Where do you want to install skills?',
|
|
36
|
+
choices: [
|
|
37
|
+
{
|
|
38
|
+
name: `${chalk.green('Workspace')} (.agent/skills/) - Project-specific skills`,
|
|
39
|
+
value: 'workspace'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: `${chalk.blue('Global')} (~/.gemini/antigravity/skills/) - Available everywhere`,
|
|
43
|
+
value: 'global'
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
// Step 2: Select skills with checkbox
|
|
50
|
+
const { selectedSkillNames } = await inquirer.prompt([
|
|
51
|
+
{
|
|
52
|
+
type: 'checkbox',
|
|
53
|
+
name: 'selectedSkillNames',
|
|
54
|
+
message: 'Select skills to install:',
|
|
55
|
+
choices: skills.map(skill => ({
|
|
56
|
+
name: skill.name,
|
|
57
|
+
value: skill.name,
|
|
58
|
+
checked: true
|
|
59
|
+
})),
|
|
60
|
+
pageSize: 15,
|
|
61
|
+
validate: (answer) => {
|
|
62
|
+
if (answer.length === 0) {
|
|
63
|
+
return 'Please select at least one skill.';
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
const selectedSkills = skills.filter(s => selectedSkillNames.includes(s.name));
|
|
71
|
+
|
|
72
|
+
// Step 3: Confirm installation
|
|
73
|
+
console.log('');
|
|
74
|
+
console.log(chalk.bold('📦 Skills to install:'));
|
|
75
|
+
selectedSkills.forEach(skill => {
|
|
76
|
+
console.log(` ${chalk.green('•')} ${skill.name}`);
|
|
77
|
+
});
|
|
78
|
+
console.log('');
|
|
79
|
+
|
|
80
|
+
const installPath = getInstallPath(installLocation);
|
|
81
|
+
console.log(chalk.dim(`📁 Install location: ${installPath}`));
|
|
82
|
+
console.log('');
|
|
83
|
+
|
|
84
|
+
const { confirm } = await inquirer.prompt([
|
|
85
|
+
{
|
|
86
|
+
type: 'confirm',
|
|
87
|
+
name: 'confirm',
|
|
88
|
+
message: 'Proceed with installation?',
|
|
89
|
+
default: true
|
|
90
|
+
}
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
if (!confirm) {
|
|
94
|
+
console.log(chalk.yellow('Installation cancelled.'));
|
|
95
|
+
process.exit(0);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Step 4: Install skills
|
|
99
|
+
const spinner = ora('Installing skills...').start();
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
const results = await installSkills(selectedSkills, installLocation);
|
|
103
|
+
|
|
104
|
+
spinner.succeed(chalk.green('Installation complete!'));
|
|
105
|
+
console.log('');
|
|
106
|
+
|
|
107
|
+
// Show results
|
|
108
|
+
results.forEach(result => {
|
|
109
|
+
if (result.success) {
|
|
110
|
+
console.log(` ${chalk.green('✔')} ${result.name} installed successfully`);
|
|
111
|
+
if (result.structure && result.structure.length > 1) {
|
|
112
|
+
console.log(chalk.dim(` └── ${result.structure.join(', ')}`));
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
console.log(` ${chalk.red('✖')} ${result.name} failed: ${result.error}`);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
console.log('');
|
|
120
|
+
console.log(chalk.cyan('🎉 Skills are ready to use!'));
|
|
121
|
+
console.log(chalk.dim(` Location: ${installPath}`));
|
|
122
|
+
|
|
123
|
+
} catch (error) {
|
|
124
|
+
spinner.fail(chalk.red('Installation failed'));
|
|
125
|
+
console.error(chalk.red(error.message));
|
|
126
|
+
process.exit(1);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
main().catch(error => {
|
|
131
|
+
console.error(chalk.red('Error:'), error.message);
|
|
132
|
+
process.exit(1);
|
|
133
|
+
});
|