@intellectronica/ruler 0.3.24 → 0.3.25

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/README.md CHANGED
@@ -633,7 +633,7 @@ For agents that support MCP but don't have native skills support, Ruler automati
633
633
 
634
634
  1. Copies skills to `.skillz/` directory
635
635
  2. Configures a Skillz MCP server in the agent's configuration
636
- 3. Uses `uvx` to launch the server with the absolute path to `.skillz`
636
+ 3. Uses `uvx` to launch the server with the project-relative path to `.skillz`
637
637
 
638
638
  Agents using native skills support (Claude Code, GitHub Copilot, Kilo Code, OpenAI Codex CLI, OpenCode, Pi Coding Agent, Goose, Amp, Mistral Vibe, Roo Code, Gemini CLI, and Cursor) **do not** use the Skillz MCP server and instead use their own native skills directories.
639
639
 
@@ -642,7 +642,7 @@ Example auto-generated MCP server configuration:
642
642
  ```toml
643
643
  [mcp_servers.skillz]
644
644
  command = "uvx"
645
- args = ["skillz@latest", "/absolute/path/to/project/.skillz"]
645
+ args = ["skillz@latest", ".skillz"]
646
646
  ```
647
647
 
648
648
  ### `.gitignore` Integration
@@ -808,7 +808,7 @@ async function propagateSkillsForSkillz(projectRoot, options) {
808
808
  if (options.dryRun) {
809
809
  return [
810
810
  `Copy skills from ${constants_1.RULER_SKILLS_PATH} to ${constants_1.SKILLZ_DIR}`,
811
- `Configure Skillz MCP server with absolute path to ${constants_1.SKILLZ_DIR}`,
811
+ `Configure Skillz MCP server with path to ${constants_1.SKILLZ_DIR}`,
812
812
  ];
813
813
  }
814
814
  // Use atomic replace: copy to temp, then rename
@@ -843,11 +843,11 @@ async function propagateSkillsForSkillz(projectRoot, options) {
843
843
  * Builds MCP config for Skillz server.
844
844
  */
845
845
  function buildSkillzMcpConfig(projectRoot) {
846
- const skillzAbsPath = path.resolve(projectRoot, constants_1.SKILLZ_DIR);
846
+ void projectRoot;
847
847
  return {
848
848
  [constants_1.SKILLZ_MCP_SERVER_NAME]: {
849
849
  command: 'uvx',
850
- args: ['skillz@latest', skillzAbsPath],
850
+ args: ['skillz@latest', constants_1.SKILLZ_DIR],
851
851
  },
852
852
  };
853
853
  }
@@ -260,13 +260,12 @@ async function processSingleConfiguration(agents, configuration, projectRoot, ve
260
260
  return await applyConfigurationsToAgents(agents, configuration.concatenatedRules, configuration.rulerMcpJson, configuration.config, projectRoot, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup, skillsEnabled);
261
261
  }
262
262
  /**
263
- * Adds Skillz MCP server to rulerMcpJson if skills exist and any agent needs it.
263
+ * Adds Skillz MCP server to rulerMcpJson if skills exist and this agent needs it.
264
264
  * Returns augmented MCP config or original if no changes needed.
265
265
  */
266
- async function addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agents, verbose) {
267
- // Check if any agent supports MCP stdio but not native skills
268
- const hasAgentNeedingSkillz = agents.some((agent) => agent.supportsMcpStdio?.() && !agent.supportsNativeSkills?.());
269
- if (!hasAgentNeedingSkillz) {
266
+ async function addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agent, verbose) {
267
+ // Check if this agent supports MCP stdio but not native skills
268
+ if (!agent.supportsMcpStdio?.() || agent.supportsNativeSkills?.()) {
270
269
  return rulerMcpJson;
271
270
  }
272
271
  // Check if .skillz directory exists
@@ -280,7 +279,7 @@ async function addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agents, ver
280
279
  // Initialize empty config if null
281
280
  const baseConfig = rulerMcpJson || { mcpServers: {} };
282
281
  const mcpServers = baseConfig.mcpServers || {};
283
- (0, constants_1.logVerbose)('Adding Skillz MCP server to configuration for agents that need it', verbose);
282
+ (0, constants_1.logVerbose)(`Adding Skillz MCP server to configuration for ${agent.getName()}`, verbose);
284
283
  return {
285
284
  ...baseConfig,
286
285
  mcpServers: {
@@ -308,17 +307,13 @@ async function addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agents, ver
308
307
  async function applyConfigurationsToAgents(agents, concatenatedRules, rulerMcpJson, config, projectRoot, verbose, dryRun, cliMcpEnabled = true, cliMcpStrategy, backup = true, skillsEnabled = true) {
309
308
  const generatedPaths = [];
310
309
  let agentsMdWritten = false;
311
- // Add Skillz MCP server to rulerMcpJson if skills are enabled
312
- // This must happen before calling agent.applyRulerConfig() so that agents
313
- // that handle MCP internally (e.g. Codex, Gemini) receive the Skillz server
314
- let augmentedRulerMcpJson = rulerMcpJson;
315
- if (skillsEnabled && !dryRun) {
316
- augmentedRulerMcpJson = await addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agents, verbose);
317
- }
318
310
  for (const agent of agents) {
319
311
  (0, constants_1.logInfo)(`Applying rules for ${agent.getName()}...`, dryRun);
320
312
  (0, constants_1.logVerbose)(`Processing agent: ${agent.getName()}`, verbose);
321
313
  const agentConfig = config.agentConfigs[agent.getIdentifier()];
314
+ const agentRulerMcpJson = skillsEnabled && !dryRun
315
+ ? await addSkillzMcpServerIfNeeded(rulerMcpJson, projectRoot, agent, verbose)
316
+ : rulerMcpJson;
322
317
  // Collect output paths for .gitignore
323
318
  const outputPaths = (0, agent_utils_1.getAgentOutputPaths)(agent, projectRoot, agentConfig);
324
319
  (0, constants_1.logVerbose)(`Agent ${agent.getName()} output paths: ${outputPaths.join(', ')}`, verbose);
@@ -344,7 +339,7 @@ async function applyConfigurationsToAgents(agents, concatenatedRules, rulerMcpJs
344
339
  }
345
340
  }
346
341
  let finalAgentConfig = agentConfig;
347
- if (agent.getIdentifier() === 'augmentcode' && augmentedRulerMcpJson) {
342
+ if (agent.getIdentifier() === 'augmentcode' && agentRulerMcpJson) {
348
343
  const resolvedStrategy = cliMcpStrategy ??
349
344
  agentConfig?.mcp?.strategy ??
350
345
  config.mcp?.strategy ??
@@ -358,11 +353,11 @@ async function applyConfigurationsToAgents(agents, concatenatedRules, rulerMcpJs
358
353
  };
359
354
  }
360
355
  if (!skipApplyForThisAgent) {
361
- await agent.applyRulerConfig(concatenatedRules, projectRoot, augmentedRulerMcpJson, finalAgentConfig, backup);
356
+ await agent.applyRulerConfig(concatenatedRules, projectRoot, agentRulerMcpJson, finalAgentConfig, backup);
362
357
  }
363
358
  }
364
359
  // Handle MCP configuration
365
- await handleMcpConfiguration(agent, agentConfig, config, augmentedRulerMcpJson, projectRoot, generatedPaths, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup, skillsEnabled);
360
+ await handleMcpConfiguration(agent, agentConfig, config, agentRulerMcpJson, projectRoot, generatedPaths, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup, skillsEnabled);
366
361
  }
367
362
  return generatedPaths;
368
363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intellectronica/ruler",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "description": "Ruler — apply the same rules to all coding agents",
5
5
  "main": "dist/lib.js",
6
6
  "scripts": {