skiller 0.9.14 → 0.10.0

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.
@@ -198,14 +198,6 @@ async function planBufferWrite(destinationPath, content, sourceLabel, plannedWri
198
198
  plannedWrites.set(destinationPath, content);
199
199
  }
200
200
  }
201
- async function planFileMigration(sourcePath, destinationPath, plannedWrites, deletePaths, conflicts) {
202
- if (!(await pathExists(sourcePath)))
203
- return;
204
- await planBufferWrite(destinationPath, await fs.readFile(sourcePath), sourcePath, plannedWrites, conflicts);
205
- if (conflicts.length === 0) {
206
- deletePaths.add(sourcePath);
207
- }
208
- }
209
201
  async function planDirectoryMigration(sourceDir, destinationDir, plannedWrites, deletePaths, conflicts) {
210
202
  if (!(await pathExists(sourceDir)))
211
203
  return;
@@ -386,7 +378,6 @@ async function migrateLegacyProjectState(projectRoot, dryRun) {
386
378
  deletePaths.add(legacyConfigPath);
387
379
  }
388
380
  }
389
- await planFileMigration(path.join(legacyDir, project_paths_1.PROJECT_AGENTS_FILE), path.join(canonicalDir, project_paths_1.PROJECT_AGENTS_FILE), plannedWrites, deletePaths, conflicts);
390
381
  if (!(await pathExists(canonicalSkillsDir))) {
391
382
  await planLegacySkillsMigration(path.join(legacyDir, 'skills'), canonicalSkillsDir, plannedWrites, deletePaths, conflicts);
392
383
  }
@@ -44,6 +44,7 @@ const SYNC_MANIFEST_RELATIVE_PATH = path
44
44
  .join(project_paths_1.CANONICAL_SKILLER_DIR, '.skiller-sync-manifest.json')
45
45
  .replace(/\\/g, '/');
46
46
  const PRESET_ROOT_ALLOWLIST = new Set([
47
+ 'AGENTS.md',
47
48
  '.agents',
48
49
  '.claude',
49
50
  '.codex',
@@ -52,6 +53,9 @@ const PRESET_ROOT_ALLOWLIST = new Set([
52
53
  ]);
53
54
  const PRESET_ROOT_IGNORES = new Set(['.DS_Store', '.git', 'node_modules']);
54
55
  const HARD_DENY_PATTERNS = [
56
+ '.agents/AGENTS.md',
57
+ '.claude/AGENTS.md',
58
+ '.claude/CLAUDE.md',
55
59
  '.agents/skills/**',
56
60
  '.claude/skills/**',
57
61
  '.agents/.skiller-sync-manifest.json',
@@ -114,7 +118,8 @@ function isHardDenied(relativePath) {
114
118
  return HARD_DENY_PATTERNS.some((pattern) => (0, FileSystemUtils_1.matchesPattern)(relativePath, pattern));
115
119
  }
116
120
  function isPresetAllowlisted(relativePath) {
117
- if (relativePath === 'skills-lock.json' ||
121
+ if (relativePath === 'AGENTS.md' ||
122
+ relativePath === 'skills-lock.json' ||
118
123
  relativePath === 'skiller-lock.json') {
119
124
  return true;
120
125
  }
@@ -183,17 +183,20 @@ async function loadUnifiedConfig(options) {
183
183
  return true;
184
184
  });
185
185
  }
186
- // Sort lexicographically then ensure AGENTS.md first
187
- mdFiles.sort((a, b) => a.localeCompare(b));
188
- mdFiles.sort((a, b) => {
189
- const aIs = /agents\.md$/i.test(a);
190
- const bIs = /agents\.md$/i.test(b);
191
- if (aIs && !bIs)
192
- return -1;
193
- if (bIs && !aIs)
194
- return 1;
195
- return 0;
196
- });
186
+ mdFiles = mdFiles
187
+ .filter((file) => path.basename(file) !== project_paths_1.PROJECT_AGENTS_FILE)
188
+ .sort((a, b) => a.localeCompare(b));
189
+ if (path.basename(meta.skillerDir) === project_paths_1.CANONICAL_SKILLER_DIR) {
190
+ const rootAgentsPath = path.join(path.dirname(meta.skillerDir), project_paths_1.PROJECT_AGENTS_FILE);
191
+ try {
192
+ await fs_1.promises.access(rootAgentsPath);
193
+ mdFiles.unshift(rootAgentsPath);
194
+ }
195
+ catch (error) {
196
+ if (error.code !== 'ENOENT')
197
+ throw error;
198
+ }
199
+ }
197
200
  let order = 0;
198
201
  ruleFiles = await Promise.all(mdFiles.map(async (file) => {
199
202
  const content = await fs_1.promises.readFile(file, 'utf8');
@@ -206,7 +209,7 @@ async function loadUnifiedConfig(options) {
206
209
  mtimeMs: stat.mtimeMs,
207
210
  size: stat.size,
208
211
  order: order++,
209
- primary: /agents\.md$/i.test(file),
212
+ primary: path.basename(file) === project_paths_1.PROJECT_AGENTS_FILE,
210
213
  };
211
214
  }));
212
215
  }
@@ -63,11 +63,11 @@ async function loadNestedConfigurations(projectRoot, configPath, localOnly, reso
63
63
  }
64
64
  /**
65
65
  * Processes each .claude directory independently, returning configuration for each.
66
- * Each .claude directory gets its own rules (not merged with others).
66
+ * Each .agents directory gets its own rules (not merged with others).
67
67
  */
68
68
  async function processIndependentSkillerDirs(skillerDirs, configPath, resolvedNested) {
69
69
  const results = [];
70
- // Process each .claude directory independently
70
+ // Process each .agents directory independently.
71
71
  for (const skillerDir of skillerDirs) {
72
72
  // Load config first to get rules filtering options
73
73
  const config = await loadConfigForSkillerDir(skillerDir, configPath, resolvedNested);
@@ -172,14 +172,14 @@ async function findSkillerDirectories(projectRoot, localOnly, hierarchical) {
172
172
  }
173
173
  }
174
174
  if (allDirs.length === 0) {
175
- throw (0, constants_1.createSkillerError)(`.claude directory not found`, `Searched from: ${projectRoot}`);
175
+ throw (0, constants_1.createSkillerError)(`.agents directory not found`, `Searched from: ${projectRoot}`);
176
176
  }
177
177
  return { dirs: allDirs, primaryDir: allDirs[0] };
178
178
  }
179
179
  else {
180
180
  const dir = await FileSystemUtils.findSkillerDir(projectRoot, !localOnly);
181
181
  if (!dir) {
182
- throw (0, constants_1.createSkillerError)(`.claude directory not found`, `Searched from: ${projectRoot}`);
182
+ throw (0, constants_1.createSkillerError)(`.agents directory not found`, `Searched from: ${projectRoot}`);
183
183
  }
184
184
  return { dirs: [dir], primaryDir: dir };
185
185
  }
@@ -191,7 +191,7 @@ async function warnAboutLegacyMcpJson(skillerDir) {
191
191
  try {
192
192
  const legacyMcpPath = path.join(skillerDir, 'mcp.json');
193
193
  await fs_1.promises.access(legacyMcpPath);
194
- (0, constants_1.logWarn)('Warning: Using legacy .claude/mcp.json. Please migrate to skiller.toml. This fallback will be removed in a future release.');
194
+ (0, constants_1.logWarn)('Warning: Using legacy .agents/mcp.json. Please migrate to skiller.toml. This fallback will be removed in a future release.');
195
195
  }
196
196
  catch {
197
197
  // ignore
@@ -237,10 +237,10 @@ async function loadSingleConfiguration(projectRoot, configPath, localOnly) {
237
237
  };
238
238
  }
239
239
  /**
240
- * Processes hierarchical configurations by applying rules to each .claude directory independently.
240
+ * Processes hierarchical configurations by applying rules to each .agents directory independently.
241
241
  * Each directory gets its own set of rules and generates its own agent files.
242
242
  * @param agents Array of agents to process
243
- * @param configurations Array of hierarchical configurations for each .claude directory
243
+ * @param configurations Array of hierarchical configurations for each .agents directory
244
244
  * @param verbose Whether to enable verbose logging
245
245
  * @param dryRun Whether to perform a dry run
246
246
  * @param cliMcpEnabled Whether MCP is enabled via CLI
@@ -250,7 +250,7 @@ async function loadSingleConfiguration(projectRoot, configPath, localOnly) {
250
250
  async function processHierarchicalConfigurations(agents, configurations, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup = true, skillsEnabled = true) {
251
251
  const allGeneratedPaths = [];
252
252
  for (const config of configurations) {
253
- (0, constants_1.logVerboseInfo)(`Processing .claude directory: ${config.skillerDir}`, verbose, dryRun);
253
+ (0, constants_1.logVerboseInfo)(`Processing .agents directory: ${config.skillerDir}`, verbose, dryRun);
254
254
  const skillerRoot = path.dirname(config.skillerDir);
255
255
  const paths = await applyConfigurationsToAgents(agents, config.concatenatedRules, config.skillerMcpJson, config.config, skillerRoot, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup, skillsEnabled, config.ruleFiles);
256
256
  const normalizedPaths = paths.map((p) => path.isAbsolute(p) ? p : path.join(skillerRoot, p));
@@ -288,7 +288,6 @@ async function applyConfigurationsToAgents(agents, concatenatedRules, skillerMcp
288
288
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
289
289
  _skillsEnabled = true, ruleFiles, skillerDir) {
290
290
  const generatedPaths = [];
291
- let agentsMdWritten = false;
292
291
  for (const agent of agents) {
293
292
  (0, constants_1.logInfo)(`Applying rules for ${agent.getName()}...`, dryRun);
294
293
  (0, constants_1.logVerbose)(`Processing agent: ${agent.getName()}`, verbose);
@@ -307,22 +306,13 @@ _skillsEnabled = true, ruleFiles, skillerDir) {
307
306
  }
308
307
  }
309
308
  if (dryRun) {
310
- (0, constants_1.logVerbose)(`DRY RUN: Would write rules to: ${outputPaths.join(', ')}`, verbose);
309
+ if (outputPaths.length > 0) {
310
+ (0, constants_1.logVerbose)(`DRY RUN: Would write rules to: ${outputPaths.join(', ')}`, verbose);
311
+ }
311
312
  }
312
313
  else {
313
- let skipApplyForThisAgent = false;
314
- if (agent.getIdentifier() === 'jules' ||
315
- agent.getIdentifier() === 'agentsmd') {
316
- if (agentsMdWritten) {
317
- // Skip rewriting AGENTS.md, but still allow MCP handling below
318
- skipApplyForThisAgent = true;
319
- }
320
- else {
321
- agentsMdWritten = true;
322
- }
323
- }
324
314
  let finalAgentConfig = agentConfig;
325
- if (agent.getIdentifier() === 'augmentcode' && skillerMcpJson) {
315
+ if (agent.getIdentifier() === 'augment' && skillerMcpJson) {
326
316
  const resolvedStrategy = cliMcpStrategy ??
327
317
  agentConfig?.mcp?.strategy ??
328
318
  config.mcp?.strategy ??
@@ -335,16 +325,14 @@ _skillsEnabled = true, ruleFiles, skillerDir) {
335
325
  },
336
326
  };
337
327
  }
338
- if (!skipApplyForThisAgent) {
339
- await agent.applySkillerConfig(concatenatedRules, projectRoot, skillerMcpJson, finalAgentConfig, backup, ruleFiles, skillerDir, config.rules?.merge_strategy);
340
- // Add .cursor/rules to gitignore when copying from .claude
341
- if (agent.getIdentifier() === 'cursor' &&
342
- config.rules?.merge_strategy === 'cursor' &&
343
- skillerDir &&
344
- path.basename(skillerDir) === '.claude') {
345
- const cursorRulesPath = path.join(projectRoot, '.cursor', 'rules');
346
- generatedPaths.push(cursorRulesPath);
347
- }
328
+ await agent.applySkillerConfig(concatenatedRules, projectRoot, skillerMcpJson, finalAgentConfig, backup, ruleFiles, skillerDir, config.rules?.merge_strategy);
329
+ // Add .cursor/rules to gitignore when copying canonical rules.
330
+ if (agent.getIdentifier() === 'cursor' &&
331
+ config.rules?.merge_strategy === 'cursor' &&
332
+ skillerDir &&
333
+ path.basename(skillerDir) === '.agents') {
334
+ const cursorRulesPath = path.join(projectRoot, '.cursor', 'rules');
335
+ generatedPaths.push(cursorRulesPath);
348
336
  }
349
337
  }
350
338
  // Handle MCP configuration
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SKILLER_CONFIG_FILE = exports.LEGACY_INSTRUCTIONS_FILE = exports.PROJECT_AGENTS_FILE = exports.LEGACY_SKILLER_DIR = exports.CANONICAL_SKILLER_DIR = void 0;
3
+ exports.SKILLER_CONFIG_FILE = exports.PROJECT_AGENTS_FILE = exports.LEGACY_SKILLER_DIR = exports.CANONICAL_SKILLER_DIR = void 0;
4
4
  exports.CANONICAL_SKILLER_DIR = '.agents';
5
5
  exports.LEGACY_SKILLER_DIR = '.claude';
6
6
  exports.PROJECT_AGENTS_FILE = 'AGENTS.md';
7
- exports.LEGACY_INSTRUCTIONS_FILE = 'instructions.md';
8
7
  exports.SKILLER_CONFIG_FILE = 'skiller.toml';
@@ -371,9 +371,9 @@ async function revertAgentConfiguration(agent, projectRoot, agentConfig, keepBac
371
371
  // Handle MCP files
372
372
  const mcpPath = await (0, mcp_1.getNativeMcpPath)(agent.getName(), projectRoot);
373
373
  if (mcpPath && mcpPath.startsWith(projectRoot)) {
374
- if (agent.getName() === 'AugmentCode' &&
374
+ if (agent.getName() === 'Augment' &&
375
375
  mcpPath.endsWith('.vscode/settings.json')) {
376
- (0, constants_1.logVerbose)(`Skipping MCP handling for AugmentCode settings.json - handled separately`, verbose);
376
+ (0, constants_1.logVerbose)(`Skipping MCP handling for Augment settings.json - handled separately`, verbose);
377
377
  }
378
378
  else {
379
379
  const mcpRestored = await restoreFromBackup(mcpPath, verbose, dryRun);
package/dist/paths/mcp.js CHANGED
@@ -58,14 +58,14 @@ async function getNativeMcpPath(adapterName, projectRoot) {
58
58
  case 'Claude Code':
59
59
  candidates.push(path.join(projectRoot, '.mcp.json'));
60
60
  break;
61
- case 'OpenAI Codex CLI':
61
+ case 'Codex':
62
62
  candidates.push(path.join(projectRoot, '.codex', 'config.toml'));
63
63
  break;
64
64
  case 'Aider':
65
65
  candidates.push(path.join(projectRoot, '.mcp.json'));
66
66
  break;
67
- case 'Open Hands':
68
- // For Open Hands, we target the main config file, not a separate mcp.json
67
+ case 'OpenHands':
68
+ // For OpenHands, target the main config file, not a separate mcp.json.
69
69
  candidates.push(path.join(projectRoot, 'config.toml'));
70
70
  break;
71
71
  case 'Gemini CLI':
@@ -80,6 +80,9 @@ async function getNativeMcpPath(adapterName, projectRoot) {
80
80
  case 'OpenCode':
81
81
  candidates.push(path.join(projectRoot, 'opencode.json'));
82
82
  break;
83
+ case 'Roo Code':
84
+ candidates.push(path.join(projectRoot, '.roo', 'mcp.json'));
85
+ break;
83
86
  case 'Firebase Studio':
84
87
  candidates.push(path.join(projectRoot, '.idx', 'mcp.json'));
85
88
  break;
package/dist/revert.js CHANGED
@@ -58,9 +58,9 @@ async function revertAllAgentConfigs(projectRoot, includedAgents, configPath, ke
58
58
  });
59
59
  const skillerDir = await FileSystemUtils.findSkillerDir(projectRoot, !localOnly);
60
60
  if (!skillerDir) {
61
- throw (0, constants_1.createSkillerError)(`.claude directory not found`, `Searched from: ${projectRoot}`);
61
+ throw (0, constants_1.createSkillerError)(`.agents directory not found`, `Searched from: ${projectRoot}`);
62
62
  }
63
- (0, constants_1.logVerbose)(`Found .claude directory at: ${skillerDir}`, verbose);
63
+ (0, constants_1.logVerbose)(`Found .agents directory at: ${skillerDir}`, verbose);
64
64
  // Normalize per-agent config keys to agent identifiers
65
65
  config.agentConfigs = (0, config_utils_1.mapRawAgentConfigs)(config.agentConfigs, agents);
66
66
  // Select agents to revert (same logic as apply, but with backward compatibility for invalid agents)
package/package.json CHANGED
@@ -1,24 +1,11 @@
1
1
  {
2
2
  "name": "skiller",
3
- "version": "0.9.14",
3
+ "version": "0.10.0",
4
4
  "description": "Skiller — apply the same rules to all coding agents",
5
5
  "main": "dist/lib.js",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "scripts": {
10
- "lint": "eslint \"src/**/*.{ts,tsx}\"",
11
- "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
12
- "format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
13
- "prepack": "pnpm build",
14
- "refresh:skills-catalog": "node scripts/refresh-skills-agent-catalog.mjs",
15
- "test": "jest",
16
- "test:watch": "jest --watch",
17
- "test:coverage": "jest --coverage",
18
- "test:integration": "jest tests/e2e/skiller.integration.test.ts --verbose",
19
- "build": "tsc",
20
- "release": "pnpm build && pnpm changeset publish"
21
- },
22
9
  "repository": {
23
10
  "type": "git",
24
11
  "url": "git+https://github.com/udecode/skiller.git"
@@ -77,5 +64,17 @@
77
64
  "ts-jest": "^29.4.5",
78
65
  "typescript": "^5.9.3",
79
66
  "typescript-eslint": "^8.46.2"
67
+ },
68
+ "scripts": {
69
+ "lint": "eslint \"src/**/*.{ts,tsx}\"",
70
+ "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
71
+ "format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
72
+ "refresh:skills-catalog": "node scripts/refresh-skills-agent-catalog.mjs",
73
+ "test": "jest",
74
+ "test:watch": "jest --watch",
75
+ "test:coverage": "jest --coverage",
76
+ "test:integration": "jest tests/e2e/skiller.integration.test.ts --verbose",
77
+ "build": "tsc",
78
+ "release": "pnpm build && pnpm changeset publish"
80
79
  }
81
- }
80
+ }