skiller 0.4.3

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.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +989 -0
  3. package/dist/agents/AbstractAgent.js +92 -0
  4. package/dist/agents/AgentsMdAgent.js +85 -0
  5. package/dist/agents/AiderAgent.js +108 -0
  6. package/dist/agents/AmazonQCliAgent.js +103 -0
  7. package/dist/agents/AmpAgent.js +13 -0
  8. package/dist/agents/AugmentCodeAgent.js +70 -0
  9. package/dist/agents/ClaudeAgent.js +95 -0
  10. package/dist/agents/ClineAgent.js +53 -0
  11. package/dist/agents/CodexCliAgent.js +143 -0
  12. package/dist/agents/CopilotAgent.js +43 -0
  13. package/dist/agents/CrushAgent.js +128 -0
  14. package/dist/agents/CursorAgent.js +93 -0
  15. package/dist/agents/FirebaseAgent.js +61 -0
  16. package/dist/agents/FirebenderAgent.js +205 -0
  17. package/dist/agents/GeminiCliAgent.js +99 -0
  18. package/dist/agents/GooseAgent.js +58 -0
  19. package/dist/agents/IAgent.js +2 -0
  20. package/dist/agents/JulesAgent.js +14 -0
  21. package/dist/agents/JunieAgent.js +53 -0
  22. package/dist/agents/KiloCodeAgent.js +63 -0
  23. package/dist/agents/KiroAgent.js +50 -0
  24. package/dist/agents/OpenCodeAgent.js +99 -0
  25. package/dist/agents/OpenHandsAgent.js +56 -0
  26. package/dist/agents/QwenCodeAgent.js +82 -0
  27. package/dist/agents/RooCodeAgent.js +139 -0
  28. package/dist/agents/TraeAgent.js +54 -0
  29. package/dist/agents/WarpAgent.js +61 -0
  30. package/dist/agents/WindsurfAgent.js +27 -0
  31. package/dist/agents/ZedAgent.js +132 -0
  32. package/dist/agents/agent-utils.js +37 -0
  33. package/dist/agents/index.js +77 -0
  34. package/dist/cli/commands.js +136 -0
  35. package/dist/cli/handlers.js +221 -0
  36. package/dist/cli/index.js +5 -0
  37. package/dist/constants.js +58 -0
  38. package/dist/core/ConfigLoader.js +274 -0
  39. package/dist/core/FileSystemUtils.js +421 -0
  40. package/dist/core/FrontmatterParser.js +142 -0
  41. package/dist/core/GitignoreUtils.js +171 -0
  42. package/dist/core/RuleProcessor.js +60 -0
  43. package/dist/core/SkillsProcessor.js +528 -0
  44. package/dist/core/SkillsUtils.js +230 -0
  45. package/dist/core/UnifiedConfigLoader.js +432 -0
  46. package/dist/core/UnifiedConfigTypes.js +2 -0
  47. package/dist/core/agent-selection.js +52 -0
  48. package/dist/core/apply-engine.js +668 -0
  49. package/dist/core/config-utils.js +30 -0
  50. package/dist/core/hash.js +24 -0
  51. package/dist/core/revert-engine.js +413 -0
  52. package/dist/lib.js +196 -0
  53. package/dist/mcp/capabilities.js +65 -0
  54. package/dist/mcp/merge.js +39 -0
  55. package/dist/mcp/propagateOpenCodeMcp.js +116 -0
  56. package/dist/mcp/propagateOpenHandsMcp.js +169 -0
  57. package/dist/mcp/validate.js +17 -0
  58. package/dist/paths/mcp.js +120 -0
  59. package/dist/revert.js +186 -0
  60. package/dist/types.js +2 -0
  61. package/dist/vscode/settings.js +117 -0
  62. package/package.json +77 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AbstractAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
39
+ /**
40
+ * Abstract base class for agents that write to a single configuration file.
41
+ * Implements common logic for applying ruler configuration.
42
+ */
43
+ class AbstractAgent {
44
+ /**
45
+ * Applies the concatenated ruler rules to the agent's configuration.
46
+ * This implementation handles the common pattern of:
47
+ * 1. Determining the output path
48
+ * 2. Ensuring the parent directory exists
49
+ * 3. Backing up the existing file
50
+ * 4. Writing the new content
51
+ */
52
+ async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true,
53
+ /* eslint-disable @typescript-eslint/no-unused-vars */
54
+ _ruleFiles, _rulerDir, _mergeStrategy) {
55
+ const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
56
+ const absolutePath = path.resolve(projectRoot, output);
57
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(absolutePath));
58
+ if (backup) {
59
+ await (0, FileSystemUtils_1.backupFile)(absolutePath);
60
+ }
61
+ await (0, FileSystemUtils_1.writeGeneratedFile)(absolutePath, concatenatedRules);
62
+ }
63
+ /**
64
+ * Returns the specific key to be used for the server object in MCP JSON.
65
+ * Defaults to 'mcpServers' if not overridden.
66
+ */
67
+ getMcpServerKey() {
68
+ return 'mcpServers';
69
+ }
70
+ /**
71
+ * Returns whether this agent supports MCP STDIO servers.
72
+ * Defaults to false if not overridden.
73
+ */
74
+ supportsMcpStdio() {
75
+ return false;
76
+ }
77
+ /**
78
+ * Returns whether this agent supports MCP remote servers.
79
+ * Defaults to false if not overridden.
80
+ */
81
+ supportsMcpRemote() {
82
+ return false;
83
+ }
84
+ /**
85
+ * Returns whether this agent has native skills support.
86
+ * Defaults to false if not overridden.
87
+ */
88
+ supportsNativeSkills() {
89
+ return false;
90
+ }
91
+ }
92
+ exports.AbstractAgent = AbstractAgent;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AgentsMdAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const fs_1 = require("fs");
39
+ const AbstractAgent_1 = require("./AbstractAgent");
40
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
41
+ /**
42
+ * Pseudo-agent that ensures the concatenated rules are written to root-level `AGENTS.md`.
43
+ * Does not participate in MCP propagation. Idempotent: only writes (and creates a backup)
44
+ * when content differs from existing file.
45
+ */
46
+ class AgentsMdAgent extends AbstractAgent_1.AbstractAgent {
47
+ getIdentifier() {
48
+ return 'agentsmd';
49
+ }
50
+ getName() {
51
+ return 'AgentsMd';
52
+ }
53
+ getDefaultOutputPath(projectRoot) {
54
+ return path.join(projectRoot, 'AGENTS.md');
55
+ }
56
+ async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true) {
57
+ const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
58
+ const absolutePath = path.resolve(projectRoot, output);
59
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(absolutePath));
60
+ // Add marker comment to the content to identify it as generated
61
+ const contentWithMarker = `<!-- Generated by Ruler -->\n${concatenatedRules}`;
62
+ // Read existing content if present and skip write if identical
63
+ let existing = null;
64
+ try {
65
+ existing = await fs_1.promises.readFile(absolutePath, 'utf8');
66
+ }
67
+ catch {
68
+ existing = null;
69
+ }
70
+ if (existing !== null && existing === contentWithMarker) {
71
+ // No change; skip backup/write for idempotency
72
+ return;
73
+ }
74
+ // Backup (only if file existed and backup is enabled) then write new content
75
+ if (backup) {
76
+ await (0, FileSystemUtils_1.backupFile)(absolutePath);
77
+ }
78
+ await (0, FileSystemUtils_1.writeGeneratedFile)(absolutePath, contentWithMarker);
79
+ }
80
+ getMcpServerKey() {
81
+ // No MCP configuration for this pseudo-agent
82
+ return '';
83
+ }
84
+ }
85
+ exports.AgentsMdAgent = AgentsMdAgent;
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AiderAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
39
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
40
+ const fs = __importStar(require("fs/promises"));
41
+ const yaml = __importStar(require("js-yaml"));
42
+ /**
43
+ * Aider agent adapter that uses AGENTS.md for instructions and .aider.conf.yml for configuration.
44
+ */
45
+ class AiderAgent {
46
+ constructor() {
47
+ this.agentsMdAgent = new AgentsMdAgent_1.AgentsMdAgent();
48
+ }
49
+ getIdentifier() {
50
+ return 'aider';
51
+ }
52
+ getName() {
53
+ return 'Aider';
54
+ }
55
+ async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig, backup = true) {
56
+ // First perform idempotent AGENTS.md write via composed AgentsMdAgent
57
+ await this.agentsMdAgent.applyRulerConfig(concatenatedRules, projectRoot, null, {
58
+ // Preserve explicit outputPath precedence semantics if provided.
59
+ outputPath: agentConfig?.outputPath ||
60
+ agentConfig?.outputPathInstructions ||
61
+ undefined,
62
+ }, backup);
63
+ // Now handle .aider.conf.yml configuration
64
+ const cfgPath = agentConfig?.outputPathConfig ??
65
+ this.getDefaultOutputPath(projectRoot).config;
66
+ let doc = {};
67
+ try {
68
+ await fs.access(cfgPath);
69
+ if (backup) {
70
+ await (0, FileSystemUtils_1.backupFile)(cfgPath);
71
+ }
72
+ const raw = await fs.readFile(cfgPath, 'utf8');
73
+ doc = (yaml.load(raw) || {});
74
+ }
75
+ catch {
76
+ doc = {};
77
+ }
78
+ if (!Array.isArray(doc.read)) {
79
+ doc.read = [];
80
+ }
81
+ // Determine the actual agents file path (AGENTS.md by default, or custom path)
82
+ const agentsPath = agentConfig?.outputPath ||
83
+ agentConfig?.outputPathInstructions ||
84
+ this.getDefaultOutputPath(projectRoot).instructions;
85
+ const name = path.basename(agentsPath);
86
+ if (!doc.read.includes(name)) {
87
+ doc.read.push(name);
88
+ }
89
+ const yamlStr = yaml.dump(doc);
90
+ await (0, FileSystemUtils_1.writeGeneratedFile)(cfgPath, yamlStr);
91
+ }
92
+ getDefaultOutputPath(projectRoot) {
93
+ return {
94
+ instructions: path.join(projectRoot, 'AGENTS.md'),
95
+ config: path.join(projectRoot, '.aider.conf.yml'),
96
+ };
97
+ }
98
+ getMcpServerKey() {
99
+ return this.agentsMdAgent.getMcpServerKey();
100
+ }
101
+ supportsMcpStdio() {
102
+ return true;
103
+ }
104
+ supportsMcpRemote() {
105
+ return true;
106
+ }
107
+ }
108
+ exports.AiderAgent = AiderAgent;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AmazonQCliAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const fs_1 = require("fs");
39
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
40
+ const merge_1 = require("../mcp/merge");
41
+ /**
42
+ * Amazon Q CLI agent adapter.
43
+ */
44
+ class AmazonQCliAgent {
45
+ getIdentifier() {
46
+ return 'amazonqcli';
47
+ }
48
+ getName() {
49
+ return 'Amazon Q CLI';
50
+ }
51
+ async applyRulerConfig(concatenatedRules, projectRoot, rulerMcpJson, agentConfig, backup = true) {
52
+ const outputPaths = this.getDefaultOutputPath(projectRoot);
53
+ const rulesPath = path.resolve(projectRoot, agentConfig?.outputPath ||
54
+ agentConfig?.outputPathInstructions ||
55
+ outputPaths['instructions']);
56
+ // Write rules file to .amazonq/rules/
57
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(rulesPath));
58
+ if (backup) {
59
+ await (0, FileSystemUtils_1.backupFile)(rulesPath);
60
+ }
61
+ await (0, FileSystemUtils_1.writeGeneratedFile)(rulesPath, concatenatedRules);
62
+ // Handle MCP configuration if enabled and provided
63
+ const mcpEnabled = agentConfig?.mcp?.enabled ?? true;
64
+ if (mcpEnabled && rulerMcpJson) {
65
+ const mcpPath = path.resolve(projectRoot, agentConfig?.outputPathConfig ?? outputPaths['mcp']);
66
+ const mcpStrategy = agentConfig?.mcp?.strategy ?? 'merge';
67
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(mcpPath));
68
+ let existingMcpConfig = {};
69
+ try {
70
+ const raw = await fs_1.promises.readFile(mcpPath, 'utf8');
71
+ existingMcpConfig = JSON.parse(raw);
72
+ }
73
+ catch (err) {
74
+ if (err.code !== 'ENOENT') {
75
+ throw err;
76
+ }
77
+ // File doesn't exist, start with empty config
78
+ }
79
+ // Merge the MCP configurations using the standard merge function
80
+ const mergedConfig = (0, merge_1.mergeMcp)(existingMcpConfig, rulerMcpJson, mcpStrategy, 'mcpServers');
81
+ if (backup) {
82
+ await (0, FileSystemUtils_1.backupFile)(mcpPath);
83
+ }
84
+ await (0, FileSystemUtils_1.writeGeneratedFile)(mcpPath, JSON.stringify(mergedConfig, null, 2));
85
+ }
86
+ }
87
+ getDefaultOutputPath(projectRoot) {
88
+ return {
89
+ instructions: path.join(projectRoot, '.amazonq', 'rules', 'ruler_q_rules.md'),
90
+ mcp: path.join(projectRoot, '.amazonq', 'mcp.json'),
91
+ };
92
+ }
93
+ getMcpServerKey() {
94
+ return 'mcpServers';
95
+ }
96
+ supportsMcpStdio() {
97
+ return true;
98
+ }
99
+ supportsMcpRemote() {
100
+ return true;
101
+ }
102
+ }
103
+ exports.AmazonQCliAgent = AmazonQCliAgent;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmpAgent = void 0;
4
+ const AgentsMdAgent_1 = require("./AgentsMdAgent");
5
+ class AmpAgent extends AgentsMdAgent_1.AgentsMdAgent {
6
+ getIdentifier() {
7
+ return 'amp';
8
+ }
9
+ getName() {
10
+ return 'Amp';
11
+ }
12
+ }
13
+ exports.AmpAgent = AmpAgent;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AugmentCodeAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
39
+ /**
40
+ * AugmentCode agent adapter.
41
+ * Generates ruler_augment_instructions.md configuration file and updates VSCode settings.json with MCP server configuration.
42
+ */
43
+ class AugmentCodeAgent {
44
+ getIdentifier() {
45
+ return 'augmentcode';
46
+ }
47
+ getName() {
48
+ return 'AugmentCode';
49
+ }
50
+ async applyRulerConfig(concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true) {
51
+ const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
52
+ if (backup) {
53
+ await (0, FileSystemUtils_1.backupFile)(output);
54
+ }
55
+ await (0, FileSystemUtils_1.writeGeneratedFile)(output, concatenatedRules);
56
+ // AugmentCode does not support MCP servers
57
+ // MCP configuration is ignored for this agent
58
+ }
59
+ getDefaultOutputPath(projectRoot) {
60
+ return path.join(projectRoot, '.augment', 'rules', 'ruler_augment_instructions.md');
61
+ }
62
+ // AugmentCode does not support MCP servers
63
+ supportsMcpStdio() {
64
+ return false;
65
+ }
66
+ supportsMcpRemote() {
67
+ return false;
68
+ }
69
+ }
70
+ exports.AugmentCodeAgent = AugmentCodeAgent;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ClaudeAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ const FileSystemUtils_1 = require("../core/FileSystemUtils");
40
+ /**
41
+ * Claude Code agent adapter.
42
+ * Uses @filename references instead of concatenating content.
43
+ */
44
+ class ClaudeAgent extends AbstractAgent_1.AbstractAgent {
45
+ getIdentifier() {
46
+ return 'claude';
47
+ }
48
+ getName() {
49
+ return 'Claude Code';
50
+ }
51
+ getDefaultOutputPath(projectRoot) {
52
+ return path.join(projectRoot, 'CLAUDE.md');
53
+ }
54
+ /**
55
+ * Override to write @filename references instead of concatenated content.
56
+ * This allows Claude Code to auto-include file contents on-demand.
57
+ */
58
+ async applyRulerConfig(_concatenatedRules, projectRoot, _rulerMcpJson, agentConfig, backup = true, ruleFiles) {
59
+ const output = agentConfig?.outputPath ?? this.getDefaultOutputPath(projectRoot);
60
+ const absolutePath = path.resolve(projectRoot, output);
61
+ await (0, FileSystemUtils_1.ensureDirExists)(path.dirname(absolutePath));
62
+ if (backup) {
63
+ await (0, FileSystemUtils_1.backupFile)(absolutePath);
64
+ }
65
+ // Generate @filename references instead of concatenated content
66
+ if (ruleFiles && ruleFiles.length > 0) {
67
+ const references = ruleFiles
68
+ .map((file) => {
69
+ // Get relative path from project root
70
+ const relativePath = path.relative(projectRoot, file.path);
71
+ // Normalize to forward slashes for consistency
72
+ const normalizedPath = relativePath.replace(/\\/g, '/');
73
+ return `@${normalizedPath}`;
74
+ })
75
+ .join('\n');
76
+ const content = `${references}
77
+ `;
78
+ await (0, FileSystemUtils_1.writeGeneratedFile)(absolutePath, content);
79
+ }
80
+ else {
81
+ // Fallback to empty file if no rules
82
+ await (0, FileSystemUtils_1.writeGeneratedFile)(absolutePath, '<!-- No rules configured -->\n');
83
+ }
84
+ }
85
+ supportsMcpStdio() {
86
+ return true;
87
+ }
88
+ supportsMcpRemote() {
89
+ return true;
90
+ }
91
+ supportsNativeSkills() {
92
+ return true;
93
+ }
94
+ }
95
+ exports.ClaudeAgent = ClaudeAgent;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.ClineAgent = void 0;
37
+ const path = __importStar(require("path"));
38
+ const AbstractAgent_1 = require("./AbstractAgent");
39
+ /**
40
+ * Cline agent adapter.
41
+ */
42
+ class ClineAgent extends AbstractAgent_1.AbstractAgent {
43
+ getIdentifier() {
44
+ return 'cline';
45
+ }
46
+ getName() {
47
+ return 'Cline';
48
+ }
49
+ getDefaultOutputPath(projectRoot) {
50
+ return path.join(projectRoot, '.clinerules');
51
+ }
52
+ }
53
+ exports.ClineAgent = ClineAgent;