const fs = require('fs'); const path = require('path'); const ROOT = process.cwd(); const SKILL = '/Users/huanghui/.codebuddy/skills/halo-theme-dev/assets/theme-vite'; // 1. 创建目录 for (const d of ['src', 'src/partials', 'src/css', 'src/js']) { fs.mkdirSync(path.join(ROOT, d), { recursive: true }); } // 2. 复制构建配置 fs.copyFileSync(path.join(SKILL, 'package.json'), path.join(ROOT, 'package.json')); fs.copyFileSync(path.join(SKILL, 'vite.config.ts'), path.join(ROOT, 'vite.config.ts')); console.log('✓ 已复制 package.json / vite.config.ts'); // 3. 从 templates/index.html 提取 layout 骨架 const idx = fs.readFileSync(path.join(ROOT, 'templates/index.html'), 'utf8'); const header = idx.match(/