agentskillsdk 0.3.0 → 0.3.2
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/package.json +1 -1
- package/src/commands/add.js +18 -19
- package/src/commands/list.js +4 -4
- package/src/index.js +7 -7
- package/src/lib/download.js +2 -2
- package/src/lib/prompt.js +2 -2
- package/src/lib/ui.js +13 -13
package/package.json
CHANGED
package/src/commands/add.js
CHANGED
|
@@ -16,7 +16,7 @@ export async function addCommand(skillName, options) {
|
|
|
16
16
|
|
|
17
17
|
// --- resolve scope flags ---
|
|
18
18
|
if (options.global && options.project) {
|
|
19
|
-
error('
|
|
19
|
+
error('kan ikke bruge både --global og --project. vælg én.');
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -38,17 +38,17 @@ export async function addCommand(skillName, options) {
|
|
|
38
38
|
(options.skill ? ` (skill: ${chalk.bold(options.skill)})` : ''));
|
|
39
39
|
} else {
|
|
40
40
|
installName = skillName;
|
|
41
|
-
const spinner = ora({ text: `
|
|
41
|
+
const spinner = ora({ text: `søger efter ${chalk.bold(skillName)}...`, indent: 2 }).start();
|
|
42
42
|
try {
|
|
43
43
|
skill = await fetchSkill(skillName);
|
|
44
44
|
} catch (err) {
|
|
45
|
-
spinner.fail('
|
|
45
|
+
spinner.fail('opslag i registret fejlede');
|
|
46
46
|
error(err.message);
|
|
47
47
|
process.exit(1);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (!skill) {
|
|
51
|
-
spinner.fail(`
|
|
51
|
+
spinner.fail(`skill "${skillName}" ikke fundet`);
|
|
52
52
|
|
|
53
53
|
let suggestions = [];
|
|
54
54
|
try {
|
|
@@ -61,14 +61,14 @@ export async function addCommand(skillName, options) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (suggestions.length > 0) {
|
|
64
|
-
console.error('\n
|
|
64
|
+
console.error('\n mente du:');
|
|
65
65
|
suggestions.forEach(s => console.error(` - ${chalk.bold(s.name)}`));
|
|
66
66
|
}
|
|
67
|
-
console.error(`\n
|
|
67
|
+
console.error(`\n se alle skills: ${chalk.underline('https://agentskills.dk/skills')}\n`);
|
|
68
68
|
process.exit(1);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
spinner.succeed(`
|
|
71
|
+
spinner.succeed(`fundet skill: ${chalk.bold(skill.name)}`);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// --- agent selection + scope prompt (with back navigation) ---
|
|
@@ -84,10 +84,9 @@ export async function addCommand(skillName, options) {
|
|
|
84
84
|
agents = detected;
|
|
85
85
|
} else if (detected.length > 1) {
|
|
86
86
|
// Prompt: all detected vs choose specific
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
{ label:
|
|
90
|
-
{ label: 'Choose specific agents...', value: 'choose' },
|
|
87
|
+
const choice = await selectPrompt('hvordan vil du installere?', [
|
|
88
|
+
{ label: `alle fundne agenter (${detected.length})`, value: 'all' },
|
|
89
|
+
{ label: 'vælg specifikke agenter', value: 'choose' },
|
|
91
90
|
]);
|
|
92
91
|
|
|
93
92
|
if (choice === null) {
|
|
@@ -100,14 +99,14 @@ export async function addCommand(skillName, options) {
|
|
|
100
99
|
} else {
|
|
101
100
|
// Checkbox from detected agents
|
|
102
101
|
const choices = detected.map(a => ({ label: a.name, value: a }));
|
|
103
|
-
const selected = await checkboxPrompt('
|
|
102
|
+
const selected = await checkboxPrompt('vælg agenter:', choices);
|
|
104
103
|
if (selected === null) continue agentSelection; // Esc → back to all/choose
|
|
105
104
|
agents = selected;
|
|
106
105
|
}
|
|
107
106
|
} else {
|
|
108
107
|
// No agents detected — show checkbox of all known agents
|
|
109
108
|
const choices = AGENTS.map(a => ({ label: a.name, value: a }));
|
|
110
|
-
const selected = await checkboxPrompt('
|
|
109
|
+
const selected = await checkboxPrompt('vælg agenter:', choices);
|
|
111
110
|
if (selected === null) {
|
|
112
111
|
// Esc with no detected agents → cancel
|
|
113
112
|
process.exit(0);
|
|
@@ -123,9 +122,9 @@ export async function addCommand(skillName, options) {
|
|
|
123
122
|
} else {
|
|
124
123
|
// Build hint using first agent (representative)
|
|
125
124
|
const a = agents[0];
|
|
126
|
-
const result = await selectPrompt('
|
|
127
|
-
{ label: '
|
|
128
|
-
{ label: '
|
|
125
|
+
const result = await selectPrompt('installationsomfang:', [
|
|
126
|
+
{ label: 'projekt', hint: `(lokalt ${a.folder}/skills/)`, value: 'project' },
|
|
127
|
+
{ label: 'globalt', hint: `(~/${a.globalFolder}/skills/)`, value: 'global' },
|
|
129
128
|
]);
|
|
130
129
|
|
|
131
130
|
if (result === null) {
|
|
@@ -147,18 +146,18 @@ export async function addCommand(skillName, options) {
|
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
// --- download to each agent ---
|
|
150
|
-
const spinner = ora({ text: '
|
|
149
|
+
const spinner = ora({ text: 'downloader skill-filer...', indent: 2 }).start();
|
|
151
150
|
try {
|
|
152
151
|
for (const agent of agents) {
|
|
153
152
|
const destDir = agent.path(installName, { cwd, scope });
|
|
154
153
|
await downloadSkill(skill, destDir);
|
|
155
154
|
}
|
|
156
155
|
} catch (err) {
|
|
157
|
-
spinner.fail('
|
|
156
|
+
spinner.fail('download fejlede');
|
|
158
157
|
error(err.message);
|
|
159
158
|
process.exit(1);
|
|
160
159
|
}
|
|
161
|
-
spinner.succeed('
|
|
160
|
+
spinner.succeed('skill-filer downloadet');
|
|
162
161
|
|
|
163
162
|
// --- completion summary ---
|
|
164
163
|
printCompletionSummary({
|
package/src/commands/list.js
CHANGED
|
@@ -13,11 +13,11 @@ export async function listCommand() {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
if (skills.length === 0) {
|
|
16
|
-
console.log('\n
|
|
16
|
+
console.log('\n ingen skills tilgængelige endnu.\n');
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
console.log(chalk.bold('\n
|
|
20
|
+
console.log(chalk.bold('\n tilgængelige skills:\n'));
|
|
21
21
|
|
|
22
22
|
const maxName = Math.max(...skills.map(s => s.name.length));
|
|
23
23
|
|
|
@@ -25,6 +25,6 @@ export async function listCommand() {
|
|
|
25
25
|
console.log(` ${chalk.cyan(skill.name.padEnd(maxName + 2))} ${skill.description}`);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
console.log(`\n
|
|
29
|
-
console.log(`
|
|
28
|
+
console.log(`\n installer: ${chalk.bold('npx agentskillsdk add <skill-name>')}`);
|
|
29
|
+
console.log(` gennemse: ${chalk.underline('https://agentskills.dk/skills')}\n`);
|
|
30
30
|
}
|
package/src/index.js
CHANGED
|
@@ -10,21 +10,21 @@ const program = new Command();
|
|
|
10
10
|
|
|
11
11
|
program
|
|
12
12
|
.name('agentskillsdk')
|
|
13
|
-
.description('
|
|
13
|
+
.description('installer agent-skills fra agentskills.dk')
|
|
14
14
|
.version(pkg.version);
|
|
15
15
|
|
|
16
16
|
program
|
|
17
17
|
.command('add')
|
|
18
|
-
.description('
|
|
19
|
-
.argument('<skill-name>', '
|
|
20
|
-
.option('--skill <path>', '
|
|
21
|
-
.option('-g, --global', '
|
|
22
|
-
.option('-p, --project', '
|
|
18
|
+
.description('installer en skill i dit projekt')
|
|
19
|
+
.argument('<skill-name>', 'navn på skill (eller owner/repo for GitHub)')
|
|
20
|
+
.option('--skill <path>', 'sti i repo, f.eks. skills/twitter')
|
|
21
|
+
.option('-g, --global', 'installer globalt i ~/.claude/skills/')
|
|
22
|
+
.option('-p, --project', 'installer i projekt .claude/skills/ (standard)')
|
|
23
23
|
.action(addCommand);
|
|
24
24
|
|
|
25
25
|
program
|
|
26
26
|
.command('list')
|
|
27
|
-
.description('
|
|
27
|
+
.description('vis alle tilgængelige skills')
|
|
28
28
|
.action(listCommand);
|
|
29
29
|
|
|
30
30
|
program.parse();
|
package/src/lib/download.js
CHANGED
|
@@ -17,10 +17,10 @@ export async function downloadSkill(skill, destDir) {
|
|
|
17
17
|
redirect: 'follow',
|
|
18
18
|
});
|
|
19
19
|
} catch {
|
|
20
|
-
throw new Error('
|
|
20
|
+
throw new Error('kunne ikke downloade skill-filer. tjek din internetforbindelse.');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (!res.ok) throw new Error(`GitHub download
|
|
23
|
+
if (!res.ok) throw new Error(`GitHub download fejlede: ${res.status}`);
|
|
24
24
|
|
|
25
25
|
const extract = tar.extract();
|
|
26
26
|
const skillPath = skill.githubPath;
|
package/src/lib/prompt.js
CHANGED
|
@@ -41,7 +41,7 @@ export function selectPrompt(question, choices, { defaultIndex = 0 } = {}) {
|
|
|
41
41
|
return ` ${marker} ${label}${hint}`;
|
|
42
42
|
});
|
|
43
43
|
lines.push('');
|
|
44
|
-
lines.push(chalk.dim(' ↑↓
|
|
44
|
+
lines.push(chalk.dim(' ↑↓ naviger · enter vælg · esc tilbage'));
|
|
45
45
|
return lines;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -155,7 +155,7 @@ export function checkboxPrompt(question, choices) {
|
|
|
155
155
|
return ` ${box} ${label}`;
|
|
156
156
|
});
|
|
157
157
|
lines.push('');
|
|
158
|
-
lines.push(chalk.dim(' ↑↓
|
|
158
|
+
lines.push(chalk.dim(' ↑↓ naviger · space skift · enter bekræft · esc tilbage'));
|
|
159
159
|
return lines;
|
|
160
160
|
}
|
|
161
161
|
|
package/src/lib/ui.js
CHANGED
|
@@ -36,7 +36,7 @@ export function box(lines, { borderColor, padding = 2 } = {}) {
|
|
|
36
36
|
export function printBanner() {
|
|
37
37
|
const lines = [
|
|
38
38
|
`${chalk.bold('agentskillsdk')} ${chalk.dim(`v${pkg.version}`)}`,
|
|
39
|
-
chalk.dim('
|
|
39
|
+
chalk.dim('installer skills til AI-agenter'),
|
|
40
40
|
];
|
|
41
41
|
console.log('');
|
|
42
42
|
console.log(box(lines));
|
|
@@ -47,26 +47,26 @@ export function printBanner() {
|
|
|
47
47
|
|
|
48
48
|
export function printCompletionSummary({ skillName, scope, agents, isGithub, namespace }) {
|
|
49
49
|
const scopeLabel = scope === 'global'
|
|
50
|
-
? '
|
|
51
|
-
: '
|
|
50
|
+
? 'globalt (alle projekter)'
|
|
51
|
+
: 'projekt (lokalt)';
|
|
52
52
|
|
|
53
53
|
const isSingle = agents.length === 1;
|
|
54
54
|
const agentNames = agents.map(a => a.name).join(', ');
|
|
55
55
|
const paths = agents.map(a => a.displayPath(skillName, scope));
|
|
56
56
|
|
|
57
57
|
const lines = [
|
|
58
|
-
chalk.bold.green('
|
|
58
|
+
chalk.bold.green('skill installeret!'),
|
|
59
59
|
'',
|
|
60
|
-
` ${chalk.dim('
|
|
61
|
-
` ${chalk.dim('
|
|
60
|
+
` ${chalk.dim('skill:')} ${skillName}`,
|
|
61
|
+
` ${chalk.dim('omfang:')} ${scopeLabel}`,
|
|
62
62
|
];
|
|
63
63
|
|
|
64
64
|
if (isSingle) {
|
|
65
|
-
lines.push(` ${chalk.dim('
|
|
66
|
-
lines.push(` ${chalk.dim('
|
|
65
|
+
lines.push(` ${chalk.dim('agent:')} ${agentNames}`);
|
|
66
|
+
lines.push(` ${chalk.dim('sti:')} ${paths[0]}`);
|
|
67
67
|
} else {
|
|
68
|
-
lines.push(` ${chalk.dim('
|
|
69
|
-
lines.push(` ${chalk.dim('
|
|
68
|
+
lines.push(` ${chalk.dim('agenter:')} ${agentNames}`);
|
|
69
|
+
lines.push(` ${chalk.dim('stier:')} ${paths[0]}`);
|
|
70
70
|
for (let i = 1; i < paths.length; i++) {
|
|
71
71
|
lines.push(` ${paths[i]}`);
|
|
72
72
|
}
|
|
@@ -74,13 +74,13 @@ export function printCompletionSummary({ skillName, scope, agents, isGithub, nam
|
|
|
74
74
|
|
|
75
75
|
lines.push('');
|
|
76
76
|
if (isSingle) {
|
|
77
|
-
lines.push(`
|
|
77
|
+
lines.push(`start en ny ${agents[0].name}-session for at bruge den.`);
|
|
78
78
|
} else {
|
|
79
|
-
lines.push('
|
|
79
|
+
lines.push('start en ny session i en af disse agenter for at bruge den.');
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
if (!isGithub && namespace) {
|
|
83
|
-
lines.push(`
|
|
83
|
+
lines.push(`læs mere: ${chalk.underline(`https://agentskills.dk/skills/${namespace}`)}`);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
console.log('');
|