sillyspec 3.7.15 → 3.7.16

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/init.js +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "3.7.15",
3
+ "version": "3.7.16",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "icon": "logo.jpg",
6
6
  "homepage": "https://sillyspec.ppdmq.top/",
package/src/init.js CHANGED
@@ -199,9 +199,12 @@ async function doInstall(projectDir, tools, isWorkspace, subprojects = []) {
199
199
  }
200
200
 
201
201
  // 复制 skills 到 .claude/skills/(给 Claude Code 使用)
202
- const skillsSource = join(homedir(), '.agents', 'skills');
203
202
  const claudeSkillsDir = join(projectDir, '.claude', 'skills');
204
- if (existsSync(skillsSource)) {
203
+ // 优先从 npm 包自带位置复制,其次从 ~/.agents/skills/
204
+ const npmSkillsDir = join(__dirname, '..', '.claude', 'skills');
205
+ const localSkillsDir = join(homedir(), '.agents', 'skills');
206
+ const skillsSource = existsSync(npmSkillsDir) ? npmSkillsDir : existsSync(localSkillsDir) ? localSkillsDir : null;
207
+ if (skillsSource) {
205
208
  const sillyspecSkills = readdirSync(skillsSource).filter(f => f.startsWith('sillyspec-') && statSync(join(skillsSource, f)).isDirectory());
206
209
  if (sillyspecSkills.length > 0) {
207
210
  mkdirSync(claudeSkillsDir, { recursive: true });
@@ -211,7 +214,7 @@ async function doInstall(projectDir, tools, isWorkspace, subprojects = []) {
211
214
  console.log(chalk.green(' ✓ Claude Code skills 已同步 (' + sillyspecSkills.length + ' 个)'));
212
215
  }
213
216
  } else {
214
- console.log(chalk.yellow(' ⚠ 未找到 ~/.agents/skills/,跳过 Claude Code skills 同步'));
217
+ console.log(chalk.yellow(' ⚠ 未找到 skills 目录,跳过 Claude Code skills 同步'));
215
218
  }
216
219
 
217
220