agent-skills-standard 1.0.6 → 1.1.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 +3 -0
- package/dist/commands/init.js +20 -1
- package/dist/commands/sync.js +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +13 -3
- package/dist/index.js +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -14,16 +14,35 @@ const constants_1 = require("../constants");
|
|
|
14
14
|
class InitCommand {
|
|
15
15
|
async run() {
|
|
16
16
|
const configPath = path_1.default.join(process.cwd(), '.skillsrc');
|
|
17
|
+
// Load package.json for dependency checks
|
|
18
|
+
const packageJsonPath = path_1.default.join(process.cwd(), 'package.json');
|
|
19
|
+
let packageDeps = {};
|
|
20
|
+
if (await fs_extra_1.default.pathExists(packageJsonPath)) {
|
|
21
|
+
try {
|
|
22
|
+
const pkg = await fs_extra_1.default.readJson(packageJsonPath);
|
|
23
|
+
packageDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
console.error(picocolors_1.default.red(`❌ Failed to read package.json: ${e instanceof Error ? e.message : String(e)}`));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
17
29
|
// Project detection
|
|
18
30
|
const detectionResults = {};
|
|
19
31
|
for (const framework of constants_1.SUPPORTED_FRAMEWORKS) {
|
|
20
32
|
let detected = false;
|
|
33
|
+
// 1. Check characteristic files
|
|
21
34
|
for (const file of framework.detectionFiles) {
|
|
22
35
|
if (await fs_extra_1.default.pathExists(file)) {
|
|
23
36
|
detected = true;
|
|
24
37
|
break;
|
|
25
38
|
}
|
|
26
39
|
}
|
|
40
|
+
// 2. Check dependencies (if not yet detected)
|
|
41
|
+
if (!detected &&
|
|
42
|
+
framework.detectionDependencies &&
|
|
43
|
+
framework.detectionDependencies.length > 0) {
|
|
44
|
+
detected = framework.detectionDependencies.some((dep) => Object.prototype.hasOwnProperty.call(packageDeps, dep));
|
|
45
|
+
}
|
|
27
46
|
detectionResults[framework.id] = detected;
|
|
28
47
|
}
|
|
29
48
|
// Agent detection
|
|
@@ -169,7 +188,7 @@ class InitCommand {
|
|
|
169
188
|
console.log(picocolors_1.default.gray(` Auto-enabled languages: ${Array.from(neededSkills)
|
|
170
189
|
.filter((s) => s !== frameworkId)
|
|
171
190
|
.join(', ') || 'none'}`));
|
|
172
|
-
console.log(picocolors_1.default.cyan('\nNext step: Run `agent-skills sync` to generate rule files.'));
|
|
191
|
+
console.log(picocolors_1.default.cyan('\nNext step: Run `agent-skills-standard sync` to generate rule files.'));
|
|
173
192
|
}
|
|
174
193
|
}
|
|
175
194
|
exports.InitCommand = InitCommand;
|
package/dist/commands/sync.js
CHANGED
|
@@ -16,7 +16,7 @@ class SyncCommand {
|
|
|
16
16
|
const configPath = path_1.default.join(process.cwd(), '.skillsrc');
|
|
17
17
|
if (!(await fs_extra_1.default.pathExists(configPath))) {
|
|
18
18
|
console.log(picocolors_1.default.red('❌ Error: .skillsrc not found in current directory.'));
|
|
19
|
-
console.log(picocolors_1.default.yellow('Run `agent-skills init` first.'));
|
|
19
|
+
console.log(picocolors_1.default.yellow('Run `agent-skills-standard init` first.'));
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
try {
|
|
@@ -9,6 +9,7 @@ export interface FrameworkDefinition {
|
|
|
9
9
|
name: string;
|
|
10
10
|
languages: string[];
|
|
11
11
|
detectionFiles: string[];
|
|
12
|
+
detectionDependencies?: string[];
|
|
12
13
|
}
|
|
13
14
|
export declare const SUPPORTED_AGENTS: AgentDefinition[];
|
|
14
15
|
export declare const SUPPORTED_FRAMEWORKS: FrameworkDefinition[];
|
package/dist/constants/index.js
CHANGED
|
@@ -8,6 +8,12 @@ exports.SUPPORTED_AGENTS = [
|
|
|
8
8
|
path: '.cursor/skills',
|
|
9
9
|
detectionFiles: ['.cursor', '.cursorrules'],
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
id: 'trae',
|
|
13
|
+
name: 'Trae',
|
|
14
|
+
path: '.trae/skills',
|
|
15
|
+
detectionFiles: ['.trae'],
|
|
16
|
+
},
|
|
11
17
|
{
|
|
12
18
|
id: 'claude',
|
|
13
19
|
name: 'Claude Code',
|
|
@@ -50,7 +56,8 @@ exports.SUPPORTED_FRAMEWORKS = [
|
|
|
50
56
|
id: 'nestjs',
|
|
51
57
|
name: 'NestJS',
|
|
52
58
|
languages: ['typescript', 'javascript'],
|
|
53
|
-
detectionFiles: ['
|
|
59
|
+
detectionFiles: ['nest-cli.json'],
|
|
60
|
+
detectionDependencies: ['@nestjs/core'],
|
|
54
61
|
},
|
|
55
62
|
{
|
|
56
63
|
id: 'golang',
|
|
@@ -63,18 +70,21 @@ exports.SUPPORTED_FRAMEWORKS = [
|
|
|
63
70
|
name: 'Next.js',
|
|
64
71
|
languages: ['typescript', 'javascript'],
|
|
65
72
|
detectionFiles: ['next.config.js', 'next.config.mjs'],
|
|
73
|
+
detectionDependencies: ['next'],
|
|
66
74
|
},
|
|
67
75
|
{
|
|
68
76
|
id: 'react',
|
|
69
77
|
name: 'React',
|
|
70
78
|
languages: ['typescript', 'javascript'],
|
|
71
|
-
detectionFiles: [
|
|
79
|
+
detectionFiles: [],
|
|
80
|
+
detectionDependencies: ['react', 'react-dom'],
|
|
72
81
|
},
|
|
73
82
|
{
|
|
74
83
|
id: 'react-native',
|
|
75
84
|
name: 'React Native',
|
|
76
85
|
languages: ['typescript', 'javascript'],
|
|
77
|
-
detectionFiles: [],
|
|
86
|
+
detectionFiles: ['metro.config.js'],
|
|
87
|
+
detectionDependencies: ['react-native'],
|
|
78
88
|
},
|
|
79
89
|
{
|
|
80
90
|
id: 'angular',
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ const init_1 = require("./commands/init");
|
|
|
6
6
|
const sync_1 = require("./commands/sync");
|
|
7
7
|
const program = new commander_1.Command();
|
|
8
8
|
program
|
|
9
|
-
.name('agent-skills')
|
|
9
|
+
.name('agent-skills-standard')
|
|
10
10
|
.description('A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, and more.')
|
|
11
|
-
.version('1.0
|
|
11
|
+
.version('1.1.0');
|
|
12
12
|
program
|
|
13
13
|
.command('init')
|
|
14
14
|
.description('Initialize a .skillsrc configuration file interactively')
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-skills-standard",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A CLI to manage and sync AI agent skills standard for Cursor, Claude, Copilot, and more.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"agent-skills-standard": "dist/index.js"
|
|
7
|
+
"agent-skills-standard": "dist/index.js",
|
|
8
|
+
"ags": "dist/index.js"
|
|
8
9
|
},
|
|
9
10
|
"files": [
|
|
10
11
|
"dist"
|