skiller 0.9.0 → 0.9.1
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.
|
@@ -38,6 +38,7 @@ exports.getCanonicalRulesDir = getCanonicalRulesDir;
|
|
|
38
38
|
exports.readUpstreamOwnedSkillNames = readUpstreamOwnedSkillNames;
|
|
39
39
|
exports.resolveSkillOwnership = resolveSkillOwnership;
|
|
40
40
|
exports.adoptSkillerOwnedSkillNames = adoptSkillerOwnedSkillNames;
|
|
41
|
+
exports.syncSkillerOwnedSkillNamesFromRules = syncSkillerOwnedSkillNamesFromRules;
|
|
41
42
|
exports.migrateLegacyProjectState = migrateLegacyProjectState;
|
|
42
43
|
const fs = __importStar(require("fs/promises"));
|
|
43
44
|
const path = __importStar(require("path"));
|
|
@@ -351,6 +352,26 @@ async function adoptSkillerOwnedSkillNames(projectRoot, skillNames, dryRun) {
|
|
|
351
352
|
}
|
|
352
353
|
await (0, SkillsManifest_1.writeLocalSkillNames)(projectRoot, [...next], dryRun);
|
|
353
354
|
}
|
|
355
|
+
async function syncSkillerOwnedSkillNamesFromRules(projectRoot, dryRun) {
|
|
356
|
+
const rulesDir = path.join(projectRoot, project_paths_1.CANONICAL_SKILLER_DIR, 'rules');
|
|
357
|
+
let ruleNames = [];
|
|
358
|
+
try {
|
|
359
|
+
const entries = await fs.readdir(rulesDir, { withFileTypes: true });
|
|
360
|
+
ruleNames = entries
|
|
361
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith('.mdc'))
|
|
362
|
+
.map((entry) => path.basename(entry.name, '.mdc'))
|
|
363
|
+
.sort((a, b) => a.localeCompare(b));
|
|
364
|
+
}
|
|
365
|
+
catch {
|
|
366
|
+
ruleNames = [];
|
|
367
|
+
}
|
|
368
|
+
const upstreamOwned = await readUpstreamOwnedSkillNames(projectRoot);
|
|
369
|
+
const nextLocalSkillNames = ruleNames.filter((name) => {
|
|
370
|
+
return !upstreamOwned.has(name);
|
|
371
|
+
});
|
|
372
|
+
await (0, SkillsManifest_1.writeLocalSkillNames)(projectRoot, nextLocalSkillNames, dryRun);
|
|
373
|
+
return nextLocalSkillNames;
|
|
374
|
+
}
|
|
354
375
|
async function migrateLegacyProjectState(projectRoot, dryRun) {
|
|
355
376
|
const legacyDir = path.join(projectRoot, project_paths_1.LEGACY_SKILLER_DIR);
|
|
356
377
|
const canonicalDir = path.join(projectRoot, project_paths_1.CANONICAL_SKILLER_DIR);
|
|
@@ -383,7 +383,7 @@ async function writeSkillsManifestEntries(projectRoot, targetSkillsDir, entries,
|
|
|
383
383
|
// Ensure `.claude` exists since the manifest lives there.
|
|
384
384
|
await fs.mkdir(projectClaudeDir, { recursive: true });
|
|
385
385
|
const targetKeys = Object.keys(existingTargets).sort((a, b) => a.localeCompare(b));
|
|
386
|
-
if (targetKeys.length === 0) {
|
|
386
|
+
if (targetKeys.length === 0 && existingLocalSkills.length === 0) {
|
|
387
387
|
await Promise.allSettled([fs.unlink(projectManifestPath)]);
|
|
388
388
|
}
|
|
389
389
|
else {
|
|
@@ -875,6 +875,7 @@ async function propagateSkills(projectRoot, agents, skillsEnabled, verbose, dryR
|
|
|
875
875
|
for (const warning of compileResult.warnings) {
|
|
876
876
|
(0, constants_1.logWarn)(warning, dryRun);
|
|
877
877
|
}
|
|
878
|
+
await (0, SkillOwnership_1.syncSkillerOwnedSkillNamesFromRules)(projectRoot, dryRun);
|
|
878
879
|
}
|
|
879
880
|
// Determine canonical skills directory, with legacy fallback for migration.
|
|
880
881
|
const skillsDir = await resolveProjectSkillsDir(projectRoot, skillerDir);
|