ai-agent-config 2.0.1 → 2.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-agent-config",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Universal Global Skills & Workflows for AI Coding Assistants (Claude Code, Antigravity, Cursor) - v2.0: User-configurable skill sources",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -12,6 +12,7 @@ const REPO_URL = "https://github.com/dongitran/ai-agent-config.git";
12
12
  const CACHE_DIR = path.join(platforms.HOME, ".ai-agent-config-cache");
13
13
  const REPO_SKILLS_DIR = path.join(CACHE_DIR, ".agent", "skills");
14
14
  const REPO_WORKFLOWS_DIR = path.join(CACHE_DIR, ".agent", "workflows");
15
+ const PACKAGE_SKILLS_DIR = path.join(__dirname, "..", "skills");
15
16
 
16
17
  /**
17
18
  * Copy directory recursively
@@ -82,15 +83,31 @@ function isRepoCached() {
82
83
  * Get list of available skills from cached repo
83
84
  */
84
85
  function getAvailableSkills() {
85
- if (!fs.existsSync(REPO_SKILLS_DIR)) {
86
- return [];
86
+ const skills = new Set();
87
+
88
+ // Get skills from repo cache
89
+ if (fs.existsSync(REPO_SKILLS_DIR)) {
90
+ fs.readdirSync(REPO_SKILLS_DIR).forEach((name) => {
91
+ const skillPath = path.join(REPO_SKILLS_DIR, name);
92
+ const skillFile = path.join(skillPath, "SKILL.md");
93
+ if (fs.statSync(skillPath).isDirectory() && fs.existsSync(skillFile)) {
94
+ skills.add(name);
95
+ }
96
+ });
97
+ }
98
+
99
+ // Get skills from package (config-manager, skill-updater)
100
+ if (fs.existsSync(PACKAGE_SKILLS_DIR)) {
101
+ fs.readdirSync(PACKAGE_SKILLS_DIR).forEach((name) => {
102
+ const skillPath = path.join(PACKAGE_SKILLS_DIR, name);
103
+ const skillFile = path.join(skillPath, "SKILL.md");
104
+ if (fs.statSync(skillPath).isDirectory() && fs.existsSync(skillFile)) {
105
+ skills.add(name);
106
+ }
107
+ });
87
108
  }
88
109
 
89
- return fs.readdirSync(REPO_SKILLS_DIR).filter((name) => {
90
- const skillPath = path.join(REPO_SKILLS_DIR, name);
91
- const skillFile = path.join(skillPath, "SKILL.md");
92
- return fs.statSync(skillPath).isDirectory() && fs.existsSync(skillFile);
93
- });
110
+ return Array.from(skills);
94
111
  }
95
112
 
96
113
  /**
@@ -170,9 +187,13 @@ function installToPlatform(platform, options = {}) {
170
187
  }
171
188
 
172
189
  for (const skillName of skillsToInstall) {
173
- const srcPath = path.join(REPO_SKILLS_DIR, skillName);
174
- const destPath = path.join(skillsPath, skillName);
190
+ // Try package skills first, then repo cache
191
+ let srcPath = path.join(PACKAGE_SKILLS_DIR, skillName);
192
+ if (!fs.existsSync(srcPath)) {
193
+ srcPath = path.join(REPO_SKILLS_DIR, skillName);
194
+ }
175
195
 
196
+ const destPath = path.join(skillsPath, skillName);
176
197
  const copyResult = copyDir(srcPath, destPath, force);
177
198
  results.skills.push({
178
199
  name: skillName,
@@ -349,4 +370,5 @@ module.exports = {
349
370
  REPO_URL,
350
371
  REPO_SKILLS_DIR,
351
372
  REPO_WORKFLOWS_DIR,
373
+ PACKAGE_SKILLS_DIR,
352
374
  };