mdk-skills 2.1.9 → 2.1.11

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": "mdk-skills",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "mdk-engineer - 沉稳靠谱的前端开发助手 Claude Skills 配置包,一键注入 .claude/ 技能目录和 CLAUDE.md 人设配置",
5
5
  "author": "XiaoMa",
6
6
  "license": "MIT",
package/scripts/cli.js CHANGED
@@ -113,6 +113,13 @@ function installSelectedSkills(selectedNames) {
113
113
  console.log(" 📝 CLAUDE.md 已创建\n");
114
114
  }
115
115
 
116
+ // 复制 profiles.json 到项目
117
+ const profilesSource = path.join(skillsSource, ".claude", "profiles.json");
118
+ const profilesDest = path.join(claudeDest, "profiles.json");
119
+ if (fs.existsSync(profilesSource) && !fs.existsSync(profilesDest)) {
120
+ fs.copyFileSync(profilesSource, profilesDest);
121
+ }
122
+
116
123
  return installedCount;
117
124
  }
118
125
 
@@ -191,6 +198,13 @@ function applyProfile(profile) {
191
198
  console.log(" 📝 CLAUDE.md 已创建\n");
192
199
  }
193
200
 
201
+ // 复制 profiles.json 到项目(方便在项目里修改后 sync 推回)
202
+ const profilesSource = path.join(skillsSource, ".claude", "profiles.json");
203
+ const profilesDest = path.join(claudeDest, "profiles.json");
204
+ if (fs.existsSync(profilesSource)) {
205
+ fs.copyFileSync(profilesSource, profilesDest);
206
+ }
207
+
194
208
  // 输出结果
195
209
  const enabledCount = selected.length;
196
210
  const disabledCount = pkgSkills.length - enabledCount;
package/scripts/core.js CHANGED
@@ -46,7 +46,13 @@ function backupDir(dir) {
46
46
 
47
47
  for (const item of fs.readdirSync(dir)) {
48
48
  if (item === "backups") continue;
49
- copyDirSync(path.join(dir, item), path.join(bakPath, item));
49
+ const srcPath = path.join(dir, item);
50
+ const destPath = path.join(bakPath, item);
51
+ if (fs.statSync(srcPath).isDirectory()) {
52
+ copyDirSync(srcPath, destPath);
53
+ } else {
54
+ fs.copyFileSync(srcPath, destPath);
55
+ }
50
56
  }
51
57
 
52
58
  // 清理旧备份,只保留最近 3 份