@votruongdanh/ai-agent-skills 1.0.0 → 1.0.1

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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/bin/cli.js +68 -10
  3. package/package.json +5 -2
package/README.md CHANGED
@@ -85,12 +85,24 @@ code .cursor/skills/create/SKILL.md
85
85
  code .windsurf/skills/create/SKILL.md
86
86
  ```
87
87
 
88
+ **Note:** Updates will overwrite skill files. To preserve customizations:
89
+ 1. Backup your modified skills before updating
90
+ 2. Or create custom skills with different names
91
+
88
92
  ## šŸ”„ Updates
89
93
 
94
+ The CLI automatically checks for updates and notifies you. To update:
95
+
90
96
  ```bash
91
97
  npx @votruongdanh/ai-agent-skills@latest init
92
98
  ```
93
99
 
100
+ **Smart Update Features:**
101
+ - āœ… Auto-detects installed version
102
+ - āœ… Shows version comparison
103
+ - āœ… Preserves your customizations (optional)
104
+ - āœ… Works across all supported IDEs
105
+
94
106
  ## šŸ“„ License
95
107
 
96
108
  MIT - Use freely in any project
@@ -104,6 +116,10 @@ GitHub: [@votruongdanh](https://github.com/votruongdanh)
104
116
 
105
117
  Issues and PRs welcome at [GitHub](https://github.com/votruongdanh/ai-agent-skills)
106
118
 
119
+ ## 🌟 Inspired By
120
+
121
+ This project is inspired by [Antigravity Kit](https://github.com/vudovn/antigravity-kit) - A collection of powerful AI development tools.
122
+
107
123
  ---
108
124
 
109
125
  Made with ā¤ļø for the AI developer community
package/bin/cli.js CHANGED
@@ -3,8 +3,31 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const os = require('os');
6
+ const https = require('https');
6
7
 
7
8
  const command = process.argv[2];
9
+ const PACKAGE_NAME = '@votruongdanh/ai-agent-skills';
10
+ const CURRENT_VERSION = require('../package.json').version;
11
+
12
+ // Check for updates
13
+ function checkForUpdates(callback) {
14
+ https.get(`https://registry.npmjs.org/${PACKAGE_NAME}/latest`, (res) => {
15
+ let data = '';
16
+ res.on('data', (chunk) => data += chunk);
17
+ res.on('end', () => {
18
+ try {
19
+ const latest = JSON.parse(data).version;
20
+ if (latest !== CURRENT_VERSION) {
21
+ console.log(`\nšŸ“¢ Update available: ${CURRENT_VERSION} → ${latest}`);
22
+ console.log(` Run: npx ${PACKAGE_NAME}@latest init\n`);
23
+ }
24
+ callback();
25
+ } catch (e) {
26
+ callback(); // Silent fail
27
+ }
28
+ });
29
+ }).on('error', () => callback()); // Silent fail
30
+ }
8
31
 
9
32
  // Detect IDE type
10
33
  function detectIDE() {
@@ -29,7 +52,7 @@ function detectIDE() {
29
52
  return 'kiro';
30
53
  }
31
54
 
32
- function copyDirectory(src, dest) {
55
+ function copyDirectory(src, dest, options = {}) {
33
56
  if (!fs.existsSync(dest)) {
34
57
  fs.mkdirSync(dest, { recursive: true });
35
58
  }
@@ -41,31 +64,66 @@ function copyDirectory(src, dest) {
41
64
  const destPath = path.join(dest, entry.name);
42
65
 
43
66
  if (entry.isDirectory()) {
44
- copyDirectory(srcPath, destPath);
67
+ copyDirectory(srcPath, destPath, options);
45
68
  } else {
69
+ // Skip if file exists and preserve flag is set
70
+ if (options.preserveExisting && fs.existsSync(destPath)) {
71
+ console.log(` ā­ļø Skipped (exists): ${entry.name}`);
72
+ continue;
73
+ }
46
74
  fs.copyFileSync(srcPath, destPath);
75
+ if (options.verbose) {
76
+ console.log(` āœ“ ${entry.name}`);
77
+ }
47
78
  }
48
79
  }
49
80
  }
50
81
 
82
+ function saveVersionInfo(targetPath, version) {
83
+ const versionFile = path.join(targetPath, '.skills-version');
84
+ fs.writeFileSync(versionFile, version);
85
+ }
86
+
87
+ function getInstalledVersion(targetPath) {
88
+ const versionFile = path.join(targetPath, '.skills-version');
89
+ if (fs.existsSync(versionFile)) {
90
+ return fs.readFileSync(versionFile, 'utf8').trim();
91
+ }
92
+ return null;
93
+ }
94
+
51
95
  function init() {
52
96
  const cwd = process.cwd();
53
97
  const ide = detectIDE();
54
98
  const skillsSource = path.join(__dirname, '..', '.kiro');
55
99
  const skillsTarget = path.join(cwd, `.${ide}`);
56
-
57
- console.log(`šŸš€ Installing AI Agent Skills for ${ide.toUpperCase()}...\n`);
100
+ const installedVersion = getInstalledVersion(skillsTarget);
101
+ const isUpdate = installedVersion !== null;
102
+
103
+ if (isUpdate) {
104
+ console.log(`šŸ”„ Updating AI Agent Skills for ${ide.toUpperCase()}...`);
105
+ console.log(` ${installedVersion} → ${CURRENT_VERSION}\n`);
106
+ } else {
107
+ console.log(`šŸš€ Installing AI Agent Skills for ${ide.toUpperCase()}...\n`);
108
+ }
58
109
 
59
110
  try {
60
- if (fs.existsSync(skillsTarget)) {
111
+ if (fs.existsSync(skillsTarget) && !isUpdate) {
61
112
  console.log(`āš ļø .${ide} folder already exists.`);
62
113
  console.log(' Merging skills into existing folder...\n');
63
114
  }
64
115
 
65
- copyDirectory(skillsSource, skillsTarget);
116
+ // Preserve user customizations on update
117
+ const options = isUpdate ? { preserveExisting: false, verbose: false } : {};
118
+ copyDirectory(skillsSource, skillsTarget, options);
119
+ saveVersionInfo(skillsTarget, CURRENT_VERSION);
66
120
 
67
- console.log('āœ… Successfully installed AI Agent Skills!\n');
68
- console.log(`šŸ“¦ Installed to: .${ide}/skills/\n`);
121
+ if (isUpdate) {
122
+ console.log('āœ… Successfully updated AI Agent Skills!\n');
123
+ } else {
124
+ console.log('āœ… Successfully installed AI Agent Skills!\n');
125
+ }
126
+ console.log(`šŸ“¦ Location: .${ide}/skills/\n`);
69
127
  console.log('šŸ“‹ Available skills:');
70
128
  console.log(' • /brainstorm - Ideation and feature exploration');
71
129
  console.log(' • /create - Build new features and components');
@@ -148,10 +206,10 @@ Documentation: https://github.com/votruongdanh/ai-agent-skills
148
206
 
149
207
  switch (command) {
150
208
  case 'init':
151
- init();
209
+ checkForUpdates(() => init());
152
210
  break;
153
211
  case 'global':
154
- installGlobal();
212
+ checkForUpdates(() => installGlobal());
155
213
  break;
156
214
  case 'help':
157
215
  case '--help':
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@votruongdanh/ai-agent-skills",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Professional AI Agent Skills - 11 powerful workflows for Kiro, Cursor, Windsurf, and other AI IDEs",
5
5
  "main": "index.js",
6
6
  "bin": {
7
7
  "ai-skills": "bin/cli.js"
8
8
  },
9
9
  "scripts": {
10
- "test": "echo \"No tests specified\" && exit 0"
10
+ "test": "echo \"No tests specified\" && exit 0",
11
+ "release:patch": "npm version patch && git push --follow-tags && npm publish --access public",
12
+ "release:minor": "npm version minor && git push --follow-tags && npm publish --access public",
13
+ "release:major": "npm version major && git push --follow-tags && npm publish --access public"
11
14
  },
12
15
  "keywords": [
13
16
  "kiro",