erne-universal 0.10.11 → 0.10.12
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/lib/generate.js +22 -2
- package/lib/init.js +1 -1
- package/package.json +1 -1
package/lib/generate.js
CHANGED
|
@@ -238,8 +238,28 @@ function generateConfig(erneRoot, targetDir, detection, profile, mcpSelections)
|
|
|
238
238
|
const ruleLayers = determineRuleLayers(detection, cwd);
|
|
239
239
|
let mcpCount = 0;
|
|
240
240
|
|
|
241
|
-
// 1. Copy universal content (commands, contexts, skills, hook scripts)
|
|
242
|
-
|
|
241
|
+
// 1. Copy universal content (commands as skills, contexts, skills, hook scripts)
|
|
242
|
+
|
|
243
|
+
// Remove old .claude/commands/ directory from previous installs
|
|
244
|
+
const oldCommandsDir = path.join(targetDir, 'commands');
|
|
245
|
+
if (fs.existsSync(oldCommandsDir)) {
|
|
246
|
+
fs.rmSync(oldCommandsDir, { recursive: true, force: true });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Copy commands as Claude Code skills: commands/foo.md → skills/foo/SKILL.md
|
|
250
|
+
const commandsSrc = path.join(erneRoot, 'commands');
|
|
251
|
+
if (fs.existsSync(commandsSrc)) {
|
|
252
|
+
const commandFiles = fs.readdirSync(commandsSrc).filter(f => f.endsWith('.md'));
|
|
253
|
+
for (const file of commandFiles) {
|
|
254
|
+
const name = path.basename(file, '.md');
|
|
255
|
+
const skillDir = path.join(targetDir, 'skills', name);
|
|
256
|
+
fs.mkdirSync(skillDir, { recursive: true });
|
|
257
|
+
fs.copyFileSync(path.join(commandsSrc, file), path.join(skillDir, 'SKILL.md'));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Copy contexts and skills directories
|
|
262
|
+
const universalDirs = ['contexts', 'skills'];
|
|
243
263
|
for (const dir of universalDirs) {
|
|
244
264
|
const src = path.join(erneRoot, dir);
|
|
245
265
|
if (fs.existsSync(src)) {
|
package/lib/init.js
CHANGED
|
@@ -234,7 +234,7 @@ module.exports = async function init() {
|
|
|
234
234
|
const { ruleLayers, mcpCount } = generateConfig(erneRoot, claudeDir, detection, profile, enabledMcp);
|
|
235
235
|
|
|
236
236
|
// Print what was generated
|
|
237
|
-
console.log(` ✓ .claude/ (agents,
|
|
237
|
+
console.log(` ✓ .claude/ (agents, skills, rules, contexts, hooks)`);
|
|
238
238
|
console.log(` ✓ .claude/rules/ (layers: ${ruleLayers.join(', ')})`);
|
|
239
239
|
console.log(` ✓ .claude/hooks.json (${profile} profile)`);
|
|
240
240
|
console.log(` ✓ .claude/mcp/ (${mcpCount} servers)`);
|