@michaelhartmayer/agentctl 1.0.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.
@@ -0,0 +1,62 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
+ import path from 'path';
3
+ import fs from 'fs-extra';
4
+ import { createTestDir, cleanupTestDir } from './helpers';
5
+ import { installSkill } from '../src/ctl';
6
+
7
+ describe('ctl install-skill', () => {
8
+ let cwd: string;
9
+ beforeEach(async () => {
10
+ cwd = await createTestDir();
11
+ });
12
+ afterEach(async () => {
13
+ await cleanupTestDir(cwd);
14
+ });
15
+
16
+ it('installs cursor skill', async () => {
17
+ await installSkill('cursor', { cwd });
18
+
19
+ const skillPath = path.join(cwd, '.cursor', 'skills', 'agentctl.md');
20
+ expect(await fs.pathExists(skillPath)).toBe(true);
21
+ const content = await fs.readFile(skillPath, 'utf-8');
22
+ expect(content).toContain('Agent Controller (agentctl)');
23
+ expect(content).toContain('Core Capabilities');
24
+ });
25
+
26
+ it('installs agentsmd skill', async () => {
27
+ await installSkill('agentsmd', { cwd });
28
+
29
+ const skillPath = path.join(cwd, '.agents', 'skills', 'agentctl', 'SKILL.md');
30
+ expect(await fs.pathExists(skillPath)).toBe(true);
31
+ const content = await fs.readFile(skillPath, 'utf-8');
32
+ expect(content).toContain('name: agentctl');
33
+ expect(content).toContain('Agent Controller (agentctl)');
34
+ expect(content).toContain('Core Capabilities');
35
+ });
36
+
37
+ it('installs gemini skill', async () => {
38
+ await installSkill('gemini', { cwd });
39
+
40
+ const skillPath = path.join(cwd, '.gemini', 'skills', 'agentctl', 'SKILL.md');
41
+ expect(await fs.pathExists(skillPath)).toBe(true);
42
+ const content = await fs.readFile(skillPath, 'utf-8');
43
+ expect(content).toContain('name: agentctl');
44
+ expect(content).toContain('Agent Controller (agentctl)');
45
+ expect(content).toContain('Best Practices for Agents');
46
+ });
47
+
48
+ it('installs gemini skill globally', async () => {
49
+ const globalDir = path.join(cwd, 'global-gemini');
50
+ await installSkill('gemini', { cwd, global: true, geminiGlobalDir: globalDir });
51
+
52
+ const skillPath = path.join(globalDir, 'skills', 'agentctl', 'SKILL.md');
53
+ expect(await fs.pathExists(skillPath)).toBe(true);
54
+ const content = await fs.readFile(skillPath, 'utf-8');
55
+ expect(content).toContain('Agent Controller (agentctl)');
56
+ });
57
+
58
+ it('fails for unknown agent', async () => {
59
+ await expect(installSkill('unknown', { cwd }))
60
+ .rejects.toThrow(/Supported agents/);
61
+ });
62
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2016",
4
+ "module": "commonjs",
5
+ "rootDir": "src",
6
+ "outDir": "dist",
7
+ "esModuleInterop": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "strict": true,
10
+ "skipLibCheck": true
11
+ },
12
+ "include": [
13
+ "src/**/*"
14
+ ],
15
+ "exclude": [
16
+ "node_modules",
17
+ "tests",
18
+ "scripts"
19
+ ]
20
+ }
@@ -0,0 +1,9 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'node',
7
+ include: ['tests/**/*.test.ts'],
8
+ },
9
+ });