ai-agent-skills 1.2.2 → 1.6.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.
- package/README.md +1 -1
- package/cli.js +96 -35
- package/package.json +1 -1
package/README.md
CHANGED
package/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ const AGENT_PATHS = {
|
|
|
24
24
|
copilot: path.join(process.cwd(), '.github', 'skills'),
|
|
25
25
|
project: path.join(process.cwd(), '.skills'),
|
|
26
26
|
goose: path.join(os.homedir(), '.config', 'goose', 'skills'),
|
|
27
|
-
opencode: path.join(os.homedir(), '.opencode', '
|
|
27
|
+
opencode: path.join(os.homedir(), '.opencode', 'skill'),
|
|
28
28
|
codex: path.join(os.homedir(), '.codex', 'skills'),
|
|
29
29
|
letta: path.join(os.homedir(), '.letta', 'skills'),
|
|
30
30
|
};
|
|
@@ -143,10 +143,14 @@ function getAvailableSkills() {
|
|
|
143
143
|
|
|
144
144
|
function parseArgs(args) {
|
|
145
145
|
const config = loadConfig();
|
|
146
|
+
const validAgents = Object.keys(AGENT_PATHS);
|
|
147
|
+
const defaultAgent = config.defaultAgent || 'claude';
|
|
148
|
+
|
|
146
149
|
const result = {
|
|
147
150
|
command: null,
|
|
148
151
|
param: null,
|
|
149
|
-
|
|
152
|
+
agents: [], // New: array of agents
|
|
153
|
+
allAgents: false, // New: --all-agents flag
|
|
150
154
|
installed: false,
|
|
151
155
|
all: false,
|
|
152
156
|
dryRun: false,
|
|
@@ -154,17 +158,33 @@ function parseArgs(args) {
|
|
|
154
158
|
category: null
|
|
155
159
|
};
|
|
156
160
|
|
|
157
|
-
const validAgents = Object.keys(AGENT_PATHS);
|
|
158
|
-
|
|
159
161
|
for (let i = 0; i < args.length; i++) {
|
|
160
162
|
const arg = args[i];
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
// --agents claude,cursor,codex (multiple agents)
|
|
165
|
+
if (arg === '--agents') {
|
|
166
|
+
const value = args[i + 1] || '';
|
|
167
|
+
value.split(',').forEach(a => {
|
|
168
|
+
const agent = a.trim();
|
|
169
|
+
if (validAgents.includes(agent) && !result.agents.includes(agent)) {
|
|
170
|
+
result.agents.push(agent);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
i++;
|
|
174
|
+
}
|
|
175
|
+
// --agent cursor (single agent, backward compatible)
|
|
176
|
+
else if (arg === '--agent' || arg === '-a') {
|
|
177
|
+
let agentValue = args[i + 1] || defaultAgent;
|
|
164
178
|
agentValue = agentValue.replace(/^-+/, '');
|
|
165
|
-
|
|
179
|
+
if (validAgents.includes(agentValue) && !result.agents.includes(agentValue)) {
|
|
180
|
+
result.agents.push(agentValue);
|
|
181
|
+
}
|
|
166
182
|
i++;
|
|
167
183
|
}
|
|
184
|
+
// --all-agents (install to all known agents)
|
|
185
|
+
else if (arg === '--all-agents') {
|
|
186
|
+
result.allAgents = true;
|
|
187
|
+
}
|
|
168
188
|
else if (arg === '--installed' || arg === '-i') {
|
|
169
189
|
result.installed = true;
|
|
170
190
|
}
|
|
@@ -185,7 +205,9 @@ function parseArgs(args) {
|
|
|
185
205
|
else if (arg.startsWith('--')) {
|
|
186
206
|
const potentialAgent = arg.replace(/^--/, '');
|
|
187
207
|
if (validAgents.includes(potentialAgent)) {
|
|
188
|
-
result.
|
|
208
|
+
if (!result.agents.includes(potentialAgent)) {
|
|
209
|
+
result.agents.push(potentialAgent);
|
|
210
|
+
}
|
|
189
211
|
} else if (!result.command) {
|
|
190
212
|
result.command = arg;
|
|
191
213
|
}
|
|
@@ -197,6 +219,17 @@ function parseArgs(args) {
|
|
|
197
219
|
}
|
|
198
220
|
}
|
|
199
221
|
|
|
222
|
+
// Resolve final agents list
|
|
223
|
+
if (result.allAgents) {
|
|
224
|
+
result.agents = [...validAgents];
|
|
225
|
+
} else if (result.agents.length === 0) {
|
|
226
|
+
// Use config agents or default
|
|
227
|
+
const configAgents = config.agents && config.agents.length > 0
|
|
228
|
+
? config.agents.filter(a => validAgents.includes(a))
|
|
229
|
+
: [];
|
|
230
|
+
result.agents = configAgents.length > 0 ? configAgents : [defaultAgent];
|
|
231
|
+
}
|
|
232
|
+
|
|
200
233
|
return result;
|
|
201
234
|
}
|
|
202
235
|
|
|
@@ -1036,12 +1069,14 @@ ${colors.bold}Commands:${colors.reset}
|
|
|
1036
1069
|
${colors.green}help${colors.reset} Show this help
|
|
1037
1070
|
|
|
1038
1071
|
${colors.bold}Options:${colors.reset}
|
|
1039
|
-
${colors.cyan}--agent <name>${colors.reset}
|
|
1040
|
-
${colors.cyan}--
|
|
1041
|
-
${colors.cyan}--
|
|
1042
|
-
${colors.cyan}--
|
|
1043
|
-
${colors.cyan}--
|
|
1044
|
-
${colors.cyan}--
|
|
1072
|
+
${colors.cyan}--agent <name>${colors.reset} Target single agent (default: claude)
|
|
1073
|
+
${colors.cyan}--agents <list>${colors.reset} Target multiple agents (comma-separated)
|
|
1074
|
+
${colors.cyan}--all-agents${colors.reset} Target ALL known agents at once
|
|
1075
|
+
${colors.cyan}--installed${colors.reset} Show only installed skills (with list)
|
|
1076
|
+
${colors.cyan}--dry-run, -n${colors.reset} Preview changes without applying
|
|
1077
|
+
${colors.cyan}--category <c>${colors.reset} Filter by category
|
|
1078
|
+
${colors.cyan}--all${colors.reset} Apply to all (with update)
|
|
1079
|
+
${colors.cyan}--version, -v${colors.reset} Show version number
|
|
1045
1080
|
|
|
1046
1081
|
${colors.bold}Agents:${colors.reset}
|
|
1047
1082
|
${colors.cyan}claude${colors.reset} (default) ~/.claude/skills/
|
|
@@ -1050,7 +1085,7 @@ ${colors.bold}Agents:${colors.reset}
|
|
|
1050
1085
|
${colors.cyan}vscode${colors.reset} .github/skills/ in current project
|
|
1051
1086
|
${colors.cyan}copilot${colors.reset} .github/skills/ (alias for vscode)
|
|
1052
1087
|
${colors.cyan}goose${colors.reset} ~/.config/goose/skills/
|
|
1053
|
-
${colors.cyan}opencode${colors.reset} ~/.opencode/
|
|
1088
|
+
${colors.cyan}opencode${colors.reset} ~/.opencode/skill/
|
|
1054
1089
|
${colors.cyan}codex${colors.reset} ~/.codex/skills/
|
|
1055
1090
|
${colors.cyan}letta${colors.reset} ~/.letta/skills/
|
|
1056
1091
|
${colors.cyan}project${colors.reset} .skills/ in current directory (portable)
|
|
@@ -1065,6 +1100,8 @@ ${colors.bold}Examples:${colors.reset}
|
|
|
1065
1100
|
npx ai-agent-skills install anthropics/skills/pdf # Install specific skill from GitHub
|
|
1066
1101
|
npx ai-agent-skills install ./my-skill # Install from local path
|
|
1067
1102
|
npx ai-agent-skills install pdf --agent cursor # Install for Cursor
|
|
1103
|
+
npx ai-agent-skills install pdf --agents claude,cursor # Install for multiple agents
|
|
1104
|
+
npx ai-agent-skills install pdf --all-agents # Install for ALL agents
|
|
1068
1105
|
npx ai-agent-skills install pdf --dry-run # Preview install
|
|
1069
1106
|
npx ai-agent-skills list --category development
|
|
1070
1107
|
npx ai-agent-skills search testing
|
|
@@ -1127,21 +1164,32 @@ function showConfig() {
|
|
|
1127
1164
|
log(`${colors.dim}File: ${CONFIG_FILE}${colors.reset}\n`);
|
|
1128
1165
|
|
|
1129
1166
|
log(`${colors.bold}defaultAgent:${colors.reset} ${config.defaultAgent || 'claude'}`);
|
|
1167
|
+
log(`${colors.bold}agents:${colors.reset} ${config.agents ? config.agents.join(', ') : '(not set, uses defaultAgent)'}`);
|
|
1130
1168
|
log(`${colors.bold}autoUpdate:${colors.reset} ${config.autoUpdate || false}`);
|
|
1131
1169
|
|
|
1132
|
-
log(`\n${colors.dim}
|
|
1170
|
+
log(`\n${colors.dim}Set default agents: npx ai-agent-skills config --agents claude,cursor${colors.reset}`);
|
|
1133
1171
|
}
|
|
1134
1172
|
|
|
1135
1173
|
function setConfig(key, value) {
|
|
1136
1174
|
const config = loadConfig();
|
|
1175
|
+
const validAgents = Object.keys(AGENT_PATHS);
|
|
1137
1176
|
|
|
1138
1177
|
if (key === 'default-agent' || key === 'defaultAgent') {
|
|
1139
1178
|
if (!AGENT_PATHS[value]) {
|
|
1140
1179
|
error(`Invalid agent: ${value}`);
|
|
1141
|
-
log(`Valid agents: ${
|
|
1180
|
+
log(`Valid agents: ${validAgents.join(', ')}`);
|
|
1142
1181
|
return false;
|
|
1143
1182
|
}
|
|
1144
1183
|
config.defaultAgent = value;
|
|
1184
|
+
} else if (key === 'agents') {
|
|
1185
|
+
// Parse comma-separated agents list
|
|
1186
|
+
const agentsList = value.split(',').map(a => a.trim()).filter(a => validAgents.includes(a));
|
|
1187
|
+
if (agentsList.length === 0) {
|
|
1188
|
+
error(`No valid agents in: ${value}`);
|
|
1189
|
+
log(`Valid agents: ${validAgents.join(', ')}`);
|
|
1190
|
+
return false;
|
|
1191
|
+
}
|
|
1192
|
+
config.agents = agentsList;
|
|
1145
1193
|
} else if (key === 'auto-update' || key === 'autoUpdate') {
|
|
1146
1194
|
config.autoUpdate = value === 'true' || value === true;
|
|
1147
1195
|
} else {
|
|
@@ -1159,7 +1207,7 @@ function setConfig(key, value) {
|
|
|
1159
1207
|
// ============ MAIN CLI ============
|
|
1160
1208
|
|
|
1161
1209
|
const args = process.argv.slice(2);
|
|
1162
|
-
const { command, param,
|
|
1210
|
+
const { command, param, agents, installed, dryRun, category, tags, all } = parseArgs(args);
|
|
1163
1211
|
|
|
1164
1212
|
// Handle config commands specially
|
|
1165
1213
|
if (command === 'config') {
|
|
@@ -1184,13 +1232,16 @@ if (command === 'config') {
|
|
|
1184
1232
|
switch (command || 'help') {
|
|
1185
1233
|
case 'browse':
|
|
1186
1234
|
case 'b':
|
|
1187
|
-
browseSkills(
|
|
1235
|
+
browseSkills(agents[0]);
|
|
1188
1236
|
break;
|
|
1189
1237
|
|
|
1190
1238
|
case 'list':
|
|
1191
1239
|
case 'ls':
|
|
1192
1240
|
if (installed) {
|
|
1193
|
-
|
|
1241
|
+
for (let i = 0; i < agents.length; i++) {
|
|
1242
|
+
if (i > 0) log('');
|
|
1243
|
+
listInstalledSkills(agents[i]);
|
|
1244
|
+
}
|
|
1194
1245
|
} else {
|
|
1195
1246
|
listSkills(category, tags);
|
|
1196
1247
|
}
|
|
@@ -1201,16 +1252,18 @@ switch (command || 'help') {
|
|
|
1201
1252
|
case 'add':
|
|
1202
1253
|
if (!param) {
|
|
1203
1254
|
error('Please specify a skill name, GitHub repo, or local path.');
|
|
1204
|
-
log('Usage: npx ai-agent-skills install <
|
|
1255
|
+
log('Usage: npx ai-agent-skills install <name> [--agents claude,cursor] [--all-agents]');
|
|
1205
1256
|
process.exit(1);
|
|
1206
1257
|
}
|
|
1207
|
-
//
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1258
|
+
// Install to all specified agents
|
|
1259
|
+
for (const agent of agents) {
|
|
1260
|
+
if (isLocalPath(param)) {
|
|
1261
|
+
installFromLocalPath(param, agent, dryRun);
|
|
1262
|
+
} else if (isGitHubUrl(param)) {
|
|
1263
|
+
installFromGitHub(param, agent, dryRun);
|
|
1264
|
+
} else {
|
|
1265
|
+
installSkill(param, agent, dryRun);
|
|
1266
|
+
}
|
|
1214
1267
|
}
|
|
1215
1268
|
break;
|
|
1216
1269
|
|
|
@@ -1219,23 +1272,29 @@ switch (command || 'help') {
|
|
|
1219
1272
|
case 'rm':
|
|
1220
1273
|
if (!param) {
|
|
1221
1274
|
error('Please specify a skill name.');
|
|
1222
|
-
log('Usage: npx ai-agent-skills uninstall <
|
|
1275
|
+
log('Usage: npx ai-agent-skills uninstall <name> [--agents claude,cursor]');
|
|
1223
1276
|
process.exit(1);
|
|
1224
1277
|
}
|
|
1225
|
-
|
|
1278
|
+
for (const agent of agents) {
|
|
1279
|
+
uninstallSkill(param, agent, dryRun);
|
|
1280
|
+
}
|
|
1226
1281
|
break;
|
|
1227
1282
|
|
|
1228
1283
|
case 'update':
|
|
1229
1284
|
case 'upgrade':
|
|
1230
1285
|
if (all) {
|
|
1231
|
-
|
|
1286
|
+
for (const agent of agents) {
|
|
1287
|
+
updateAllSkills(agent, dryRun);
|
|
1288
|
+
}
|
|
1232
1289
|
} else if (!param) {
|
|
1233
1290
|
error('Please specify a skill name or use --all.');
|
|
1234
|
-
log('Usage: npx ai-agent-skills update <
|
|
1235
|
-
log(' npx ai-agent-skills update --all [--
|
|
1291
|
+
log('Usage: npx ai-agent-skills update <name> [--agents claude,cursor]');
|
|
1292
|
+
log(' npx ai-agent-skills update --all [--agents claude,cursor]');
|
|
1236
1293
|
process.exit(1);
|
|
1237
1294
|
} else {
|
|
1238
|
-
|
|
1295
|
+
for (const agent of agents) {
|
|
1296
|
+
updateSkill(param, agent, dryRun);
|
|
1297
|
+
}
|
|
1239
1298
|
}
|
|
1240
1299
|
break;
|
|
1241
1300
|
|
|
@@ -1276,7 +1335,9 @@ switch (command || 'help') {
|
|
|
1276
1335
|
default:
|
|
1277
1336
|
// If command looks like a skill name, try to install it
|
|
1278
1337
|
if (getAvailableSkills().includes(command)) {
|
|
1279
|
-
|
|
1338
|
+
for (const agent of agents) {
|
|
1339
|
+
installSkill(command, agent, dryRun);
|
|
1340
|
+
}
|
|
1280
1341
|
} else {
|
|
1281
1342
|
error(`Unknown command: ${command}`);
|
|
1282
1343
|
showHelp();
|
package/package.json
CHANGED