mdk-skills 2.2.12 → 2.2.13

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.2.12",
3
+ "version": "2.2.13",
4
4
  "description": "mdk-engineer - 沉稳靠谱的前端开发助手 Claude Skills 配置包,一键注入 .claude/ 技能目录和 CLAUDE.md 人设配置",
5
5
  "author": "XiaoMa",
6
6
  "license": "MIT",
@@ -497,10 +497,21 @@ async function handleApi(req, res) {
497
497
  }
498
498
  }
499
499
 
500
+ // README.md 缺失状态(独立于骨架文件)
501
+ let readmeStatus = null;
502
+ if (sourcePath) {
503
+ const skillsDir = path.join(sourcePath, ".claude", "skills");
504
+ readmeStatus = {
505
+ root: fs.existsSync(path.join(sourcePath, "README.md")),
506
+ skills: fs.existsSync(path.join(skillsDir, "README.md")),
507
+ };
508
+ }
509
+
500
510
  return sendJSON(res, {
501
511
  connected: !!sourcePath,
502
512
  path: sourcePath,
503
513
  needsInit,
514
+ readmeStatus,
504
515
  });
505
516
  }
506
517
 
@@ -31,6 +31,18 @@
31
31
  >
32
32
  <template #prefix>📁</template>
33
33
  </n-input>
34
+
35
+ <!-- 独立于 init:仅 README.md 缺失时的创建入口 -->
36
+ <n-alert
37
+ v-if="sourceInfo.connected && sourceInfo.needsInit === false && hasReadmeMissing"
38
+ type="info"
39
+ :bordered="false"
40
+ class="init-alert"
41
+ >
42
+ <template #header>缺少 README.md 文档</template>
43
+ 创建后将生成模板文件,可在对应目录中自行编辑
44
+ </n-alert>
45
+
34
46
  <div class="action-buttons">
35
47
  <n-button
36
48
  v-if="!sourceInfo.connected"
@@ -56,6 +68,13 @@
56
68
  >
57
69
  同步到仓库
58
70
  </n-button>
71
+ <n-button
72
+ v-if="sourceInfo.connected && sourceInfo.needsInit === false && hasReadmeMissing"
73
+ ghost
74
+ @click="onShowCreateReadme"
75
+ >
76
+ 创建文档
77
+ </n-button>
59
78
  <n-button
60
79
  v-if="sourceInfo.connected"
61
80
  type="error"
@@ -145,7 +164,7 @@
145
164
  </template>
146
165
 
147
166
  <script setup>
148
- import { ref, onMounted } from "vue";
167
+ import { ref, computed, onMounted } from "vue";
149
168
  import { useMessage } from "naive-ui";
150
169
  import {
151
170
  CheckmarkCircleOutline,
@@ -183,6 +202,11 @@ const readmeForm = ref({
183
202
  teamName: "",
184
203
  });
185
204
 
205
+ const hasReadmeMissing = computed(() => {
206
+ if (!sourceInfo.value.readmeStatus) return false;
207
+ return !sourceInfo.value.readmeStatus.root || !sourceInfo.value.readmeStatus.skills;
208
+ });
209
+
186
210
  async function loadSource() {
187
211
  sourceInfo.value = await getSource();
188
212
  }
@@ -277,6 +301,12 @@ async function onCreateReadme() {
277
301
  }
278
302
  }
279
303
 
304
+ function onShowCreateReadme() {
305
+ readmeForm.value.root = !sourceInfo.value.readmeStatus?.root;
306
+ readmeForm.value.skills = !sourceInfo.value.readmeStatus?.skills;
307
+ showReadmeDialog.value = true;
308
+ }
309
+
280
310
  async function onDisconnect() {
281
311
  disconnecting.value = true;
282
312
  try {