add-skill 1.0.2 → 1.0.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.
- package/dist/index.js +14 -4
- package/package.json +1 -1
- package/src/agents.ts +9 -0
- package/src/index.ts +4 -4
- package/src/skills.ts +1 -0
- package/src/types.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -143,7 +143,8 @@ async function discoverSkills(basePath, subpath) {
|
|
|
143
143
|
join2(searchPath, "skills/.system"),
|
|
144
144
|
join2(searchPath, ".codex/skills"),
|
|
145
145
|
join2(searchPath, ".claude/skills"),
|
|
146
|
-
join2(searchPath, ".opencode/skill")
|
|
146
|
+
join2(searchPath, ".opencode/skill"),
|
|
147
|
+
join2(searchPath, ".cursor/skills")
|
|
147
148
|
];
|
|
148
149
|
for (const dir of prioritySearchDirs) {
|
|
149
150
|
try {
|
|
@@ -215,6 +216,15 @@ var agents = {
|
|
|
215
216
|
detectInstalled: async () => {
|
|
216
217
|
return existsSync(join3(home, ".codex"));
|
|
217
218
|
}
|
|
219
|
+
},
|
|
220
|
+
cursor: {
|
|
221
|
+
name: "cursor",
|
|
222
|
+
displayName: "Cursor",
|
|
223
|
+
skillsDir: ".cursor/skills",
|
|
224
|
+
globalSkillsDir: join3(home, ".cursor/skills"),
|
|
225
|
+
detectInstalled: async () => {
|
|
226
|
+
return existsSync(join3(home, ".cursor"));
|
|
227
|
+
}
|
|
218
228
|
}
|
|
219
229
|
};
|
|
220
230
|
async function detectInstalledAgents() {
|
|
@@ -277,7 +287,7 @@ function getInstallPath(skillName, agentType, options = {}) {
|
|
|
277
287
|
|
|
278
288
|
// src/index.ts
|
|
279
289
|
var version = "1.0.0";
|
|
280
|
-
program.name("add-skill").description("Install skills onto coding agents (OpenCode, Claude Code, Codex)").version(version).argument("<source>", "Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global", "Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>", "Specify agents to install to (opencode, claude-code, codex)").option("-s, --skill <skills...>", "Specify skill names to install (skip selection prompt)").option("-l, --list", "List available skills in the repository without installing").option("-y, --yes", "Skip confirmation prompts").action(async (source, options) => {
|
|
290
|
+
program.name("add-skill").description("Install skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)").version(version).argument("<source>", "Git repo URL, GitHub shorthand (owner/repo), or direct path to skill").option("-g, --global", "Install skill globally (user-level) instead of project-level").option("-a, --agent <agents...>", "Specify agents to install to (opencode, claude-code, codex, cursor)").option("-s, --skill <skills...>", "Specify skill names to install (skip selection prompt)").option("-l, --list", "List available skills in the repository without installing").option("-y, --yes", "Skip confirmation prompts").action(async (source, options) => {
|
|
281
291
|
await main(source, options);
|
|
282
292
|
});
|
|
283
293
|
program.parse();
|
|
@@ -359,7 +369,7 @@ async function main(source, options) {
|
|
|
359
369
|
}
|
|
360
370
|
let targetAgents;
|
|
361
371
|
if (options.agent && options.agent.length > 0) {
|
|
362
|
-
const validAgents = ["opencode", "claude-code", "codex"];
|
|
372
|
+
const validAgents = ["opencode", "claude-code", "codex", "cursor"];
|
|
363
373
|
const invalidAgents = options.agent.filter((a) => !validAgents.includes(a));
|
|
364
374
|
if (invalidAgents.length > 0) {
|
|
365
375
|
p.log.error(`Invalid agents: ${invalidAgents.join(", ")}`);
|
|
@@ -374,7 +384,7 @@ async function main(source, options) {
|
|
|
374
384
|
spinner2.stop(`Detected ${installedAgents.length} agent${installedAgents.length !== 1 ? "s" : ""}`);
|
|
375
385
|
if (installedAgents.length === 0) {
|
|
376
386
|
if (options.yes) {
|
|
377
|
-
targetAgents = ["opencode", "claude-code", "codex"];
|
|
387
|
+
targetAgents = ["opencode", "claude-code", "codex", "cursor"];
|
|
378
388
|
p.log.info("Installing to all agents (none detected)");
|
|
379
389
|
} else {
|
|
380
390
|
p.log.warn("No coding agents detected. You can still install skills.");
|
package/package.json
CHANGED
package/src/agents.ts
CHANGED
|
@@ -33,6 +33,15 @@ export const agents: Record<AgentType, AgentConfig> = {
|
|
|
33
33
|
return existsSync(join(home, '.codex'));
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
|
+
cursor: {
|
|
37
|
+
name: 'cursor',
|
|
38
|
+
displayName: 'Cursor',
|
|
39
|
+
skillsDir: '.cursor/skills',
|
|
40
|
+
globalSkillsDir: join(home, '.cursor/skills'),
|
|
41
|
+
detectInstalled: async () => {
|
|
42
|
+
return existsSync(join(home, '.cursor'));
|
|
43
|
+
},
|
|
44
|
+
},
|
|
36
45
|
};
|
|
37
46
|
|
|
38
47
|
export async function detectInstalledAgents(): Promise<AgentType[]> {
|
package/src/index.ts
CHANGED
|
@@ -21,11 +21,11 @@ interface Options {
|
|
|
21
21
|
|
|
22
22
|
program
|
|
23
23
|
.name('add-skill')
|
|
24
|
-
.description('Install skills onto coding agents (OpenCode, Claude Code, Codex)')
|
|
24
|
+
.description('Install skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)')
|
|
25
25
|
.version(version)
|
|
26
26
|
.argument('<source>', 'Git repo URL, GitHub shorthand (owner/repo), or direct path to skill')
|
|
27
27
|
.option('-g, --global', 'Install skill globally (user-level) instead of project-level')
|
|
28
|
-
.option('-a, --agent <agents...>', 'Specify agents to install to (opencode, claude-code, codex)')
|
|
28
|
+
.option('-a, --agent <agents...>', 'Specify agents to install to (opencode, claude-code, codex, cursor)')
|
|
29
29
|
.option('-s, --skill <skills...>', 'Specify skill names to install (skip selection prompt)')
|
|
30
30
|
.option('-l, --list', 'List available skills in the repository without installing')
|
|
31
31
|
.option('-y, --yes', 'Skip confirmation prompts')
|
|
@@ -131,7 +131,7 @@ async function main(source: string, options: Options) {
|
|
|
131
131
|
let targetAgents: AgentType[];
|
|
132
132
|
|
|
133
133
|
if (options.agent && options.agent.length > 0) {
|
|
134
|
-
const validAgents = ['opencode', 'claude-code', 'codex'];
|
|
134
|
+
const validAgents = ['opencode', 'claude-code', 'codex', 'cursor'];
|
|
135
135
|
const invalidAgents = options.agent.filter(a => !validAgents.includes(a));
|
|
136
136
|
|
|
137
137
|
if (invalidAgents.length > 0) {
|
|
@@ -149,7 +149,7 @@ async function main(source: string, options: Options) {
|
|
|
149
149
|
|
|
150
150
|
if (installedAgents.length === 0) {
|
|
151
151
|
if (options.yes) {
|
|
152
|
-
targetAgents = ['opencode', 'claude-code', 'codex'];
|
|
152
|
+
targetAgents = ['opencode', 'claude-code', 'codex', 'cursor'];
|
|
153
153
|
p.log.info('Installing to all agents (none detected)');
|
|
154
154
|
} else {
|
|
155
155
|
p.log.warn('No coding agents detected. You can still install skills.');
|
package/src/skills.ts
CHANGED
|
@@ -84,6 +84,7 @@ export async function discoverSkills(basePath: string, subpath?: string): Promis
|
|
|
84
84
|
join(searchPath, '.codex/skills'),
|
|
85
85
|
join(searchPath, '.claude/skills'),
|
|
86
86
|
join(searchPath, '.opencode/skill'),
|
|
87
|
+
join(searchPath, '.cursor/skills'),
|
|
87
88
|
];
|
|
88
89
|
|
|
89
90
|
for (const dir of prioritySearchDirs) {
|
package/src/types.ts
CHANGED