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,171 @@
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.updateGitignore = updateGitignore;
37
+ const fs_1 = require("fs");
38
+ const path = __importStar(require("path"));
39
+ const RULER_START_MARKER = '# START Ruler Generated Files';
40
+ const RULER_END_MARKER = '# END Ruler Generated Files';
41
+ /**
42
+ * Updates the .gitignore file in the project root with paths in a managed Ruler block.
43
+ * Creates the file if it doesn't exist, and creates or updates the Ruler-managed block.
44
+ *
45
+ * @param projectRoot The project root directory (where .gitignore should be located)
46
+ * @param paths Array of file paths to add to .gitignore (can be absolute or relative)
47
+ */
48
+ async function updateGitignore(projectRoot, paths) {
49
+ const gitignorePath = path.join(projectRoot, '.gitignore');
50
+ // Read existing .gitignore or start with empty content
51
+ let existingContent = '';
52
+ try {
53
+ existingContent = await fs_1.promises.readFile(gitignorePath, 'utf8');
54
+ }
55
+ catch (err) {
56
+ if (err.code !== 'ENOENT') {
57
+ throw err;
58
+ }
59
+ }
60
+ // Convert paths to repo-relative POSIX format with leading /
61
+ const relativePaths = paths
62
+ .map((p) => {
63
+ let relative;
64
+ if (path.isAbsolute(p)) {
65
+ relative = path.relative(projectRoot, p);
66
+ }
67
+ else {
68
+ // Handle relative paths that might include the project root prefix
69
+ const normalizedProjectRoot = path.normalize(projectRoot);
70
+ const normalizedPath = path.normalize(p);
71
+ // Get the basename of the project root to match against path prefixes
72
+ const projectBasename = path.basename(normalizedProjectRoot);
73
+ // If the path starts with the project basename, remove it
74
+ if (normalizedPath.startsWith(projectBasename + path.sep)) {
75
+ relative = normalizedPath.substring(projectBasename.length + 1);
76
+ }
77
+ else {
78
+ relative = normalizedPath;
79
+ }
80
+ }
81
+ return relative.replace(/\\/g, '/'); // Convert to POSIX format
82
+ })
83
+ .filter((p) => {
84
+ // Never include any path that resides inside a .ruler directory (inputs, not outputs)
85
+ return !p.includes('/.ruler/') && !p.startsWith('.ruler/');
86
+ })
87
+ .map((p) => {
88
+ // Always write full repository-relative paths (prefix with leading /)
89
+ return p.startsWith('/') ? p : `/${p}`;
90
+ });
91
+ // Get all existing paths from .gitignore (excluding Ruler block)
92
+ const existingPaths = getExistingPathsExcludingRulerBlock(existingContent);
93
+ // Filter out paths that already exist outside the Ruler block
94
+ const newPaths = relativePaths.filter((p) => !existingPaths.includes(p));
95
+ // The Ruler block should contain only the new paths (replacement behavior)
96
+ const allRulerPaths = [...new Set(newPaths)].sort();
97
+ // Create new content
98
+ const newContent = updateGitignoreContent(existingContent, allRulerPaths);
99
+ // Write the updated content
100
+ await fs_1.promises.writeFile(gitignorePath, newContent);
101
+ }
102
+ /**
103
+ * Gets all paths from .gitignore content excluding those in the Ruler block.
104
+ */
105
+ function getExistingPathsExcludingRulerBlock(content) {
106
+ const lines = content.split('\n');
107
+ const paths = [];
108
+ let inRulerBlock = false;
109
+ for (const line of lines) {
110
+ const trimmed = line.trim();
111
+ if (trimmed === RULER_START_MARKER) {
112
+ inRulerBlock = true;
113
+ continue;
114
+ }
115
+ if (trimmed === RULER_END_MARKER) {
116
+ inRulerBlock = false;
117
+ continue;
118
+ }
119
+ if (!inRulerBlock && trimmed && !trimmed.startsWith('#')) {
120
+ paths.push(trimmed);
121
+ }
122
+ }
123
+ return paths;
124
+ }
125
+ /**
126
+ * Updates the .gitignore content by replacing or adding the Ruler block.
127
+ */
128
+ function updateGitignoreContent(existingContent, rulerPaths) {
129
+ const lines = existingContent.split('\n');
130
+ const newLines = [];
131
+ let inFirstRulerBlock = false;
132
+ let hasRulerBlock = false;
133
+ let processedFirstBlock = false;
134
+ for (const line of lines) {
135
+ const trimmed = line.trim();
136
+ if (trimmed === RULER_START_MARKER && !processedFirstBlock) {
137
+ inFirstRulerBlock = true;
138
+ hasRulerBlock = true;
139
+ newLines.push(line);
140
+ // Add the new Ruler paths
141
+ rulerPaths.forEach((p) => newLines.push(p));
142
+ continue;
143
+ }
144
+ if (trimmed === RULER_END_MARKER && inFirstRulerBlock) {
145
+ inFirstRulerBlock = false;
146
+ processedFirstBlock = true;
147
+ newLines.push(line);
148
+ continue;
149
+ }
150
+ if (!inFirstRulerBlock) {
151
+ newLines.push(line);
152
+ }
153
+ // Skip lines that are in the first Ruler block (they get replaced)
154
+ }
155
+ // If no Ruler block exists, add one at the end
156
+ if (!hasRulerBlock) {
157
+ // Add blank line if content exists and doesn't end with blank line
158
+ if (existingContent.trim() && !existingContent.endsWith('\n\n')) {
159
+ newLines.push('');
160
+ }
161
+ newLines.push(RULER_START_MARKER);
162
+ rulerPaths.forEach((p) => newLines.push(p));
163
+ newLines.push(RULER_END_MARKER);
164
+ }
165
+ // Ensure file ends with a newline
166
+ let result = newLines.join('\n');
167
+ if (!result.endsWith('\n')) {
168
+ result += '\n';
169
+ }
170
+ return result;
171
+ }
@@ -0,0 +1,60 @@
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.concatenateRules = concatenateRules;
37
+ const path = __importStar(require("path"));
38
+ /**
39
+ * Concatenates markdown rule files into a single string,
40
+ * marking each section with its source filename.
41
+ */
42
+ function concatenateRules(files, baseDir) {
43
+ const base = baseDir || process.cwd();
44
+ const sections = files.map(({ path: filePath, content }) => {
45
+ const rel = path.relative(base, filePath);
46
+ // Normalize path separators to forward slashes for consistent output across platforms
47
+ const normalizedRel = rel.replace(/\\/g, '/');
48
+ // New format: two leading blank lines, HTML comment with source, one blank line, then content, then trailing newline
49
+ // We intentionally trim content to avoid cascading blank lines, then ensure a final newline via join logic
50
+ return [
51
+ '', // first leading blank line
52
+ '', // second leading blank line
53
+ `<!-- Source: ${normalizedRel} -->`,
54
+ '', // single blank line after the comment
55
+ content.trim(),
56
+ '', // ensure file section ends with newline
57
+ ].join('\n');
58
+ });
59
+ return sections.join('\n');
60
+ }