agent-skills-standard 2.2.2 → 2.2.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 +115 -82
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -675,7 +675,10 @@ var DEFAULT_WORKFLOWS = [
|
|
|
675
675
|
"codebase-review",
|
|
676
676
|
"plan-feature",
|
|
677
677
|
"skill-benchmark",
|
|
678
|
-
"pentest"
|
|
678
|
+
"pentest",
|
|
679
|
+
"dev-fix",
|
|
680
|
+
"implement-feature",
|
|
681
|
+
"verify-bug"
|
|
679
682
|
];
|
|
680
683
|
var getAgentDefinition = (id) => {
|
|
681
684
|
switch (id) {
|
|
@@ -3684,11 +3687,14 @@ var WorkflowSyncService = class {
|
|
|
3684
3687
|
console.log(picocolors.default.yellow(`✨ Workflows Discovered: Adding [${newWorkflows.join(", ")}] to .skillsrc.`));
|
|
3685
3688
|
changed = true;
|
|
3686
3689
|
}
|
|
3687
|
-
} else if (config.workflows === void 0
|
|
3690
|
+
} else if (config.workflows === void 0) {
|
|
3688
3691
|
const defaultWorkflows = availableWorkflows.filter((wf) => DEFAULT_WORKFLOWS.includes(wf));
|
|
3689
3692
|
config.workflows = defaultWorkflows;
|
|
3690
3693
|
console.log(picocolors.default.yellow(`✨ Workflows Initialized: Adding [${defaultWorkflows.join(", ")}] to .skillsrc.`));
|
|
3691
3694
|
changed = true;
|
|
3695
|
+
} else if (config.workflows === true) {
|
|
3696
|
+
const newWorkflows = availableWorkflows.filter((wf) => !DEFAULT_WORKFLOWS.includes(wf));
|
|
3697
|
+
if (newWorkflows.length > 0) console.log(picocolors.default.cyan(`ℹ️ Registry has ${availableWorkflows.length} workflows (including ${newWorkflows.length} non-default). Syncing all because 'workflows: true' is set.`));
|
|
3692
3698
|
}
|
|
3693
3699
|
return changed;
|
|
3694
3700
|
}
|
|
@@ -3729,7 +3735,8 @@ var WorkflowSyncService = class {
|
|
|
3729
3735
|
content: f.content
|
|
3730
3736
|
}))
|
|
3731
3737
|
}];
|
|
3732
|
-
}
|
|
3738
|
+
} else if (workflowFiles.length > 0) console.log(picocolors.default.red(` ❌ Failed to download ${workflowFiles.length} matched workflows.`));
|
|
3739
|
+
else console.log(picocolors.default.gray(` ℹ️ No matching workflows found in registry.`));
|
|
3733
3740
|
return [];
|
|
3734
3741
|
}
|
|
3735
3742
|
/**
|
|
@@ -3887,6 +3894,97 @@ var SpecialistSyncService = class {
|
|
|
3887
3894
|
}
|
|
3888
3895
|
};
|
|
3889
3896
|
//#endregion
|
|
3897
|
+
//#region src/services/GitService.ts
|
|
3898
|
+
/**
|
|
3899
|
+
* Service for handling Git operations within the project.
|
|
3900
|
+
* Provides a clean interface for querying changed and untracked files.
|
|
3901
|
+
*/
|
|
3902
|
+
var GitService = class {
|
|
3903
|
+
/**
|
|
3904
|
+
* Finds the root of the project by looking for .git or pnpm-workspace.yaml.
|
|
3905
|
+
*/
|
|
3906
|
+
findProjectRoot(startDir = process.cwd()) {
|
|
3907
|
+
let currentDir = startDir;
|
|
3908
|
+
while (currentDir !== path.default.parse(currentDir).root) {
|
|
3909
|
+
if (fs_extra.default.existsSync(path.default.join(currentDir, "pnpm-workspace.yaml")) || fs_extra.default.existsSync(path.default.join(currentDir, ".git"))) return currentDir;
|
|
3910
|
+
currentDir = path.default.dirname(currentDir);
|
|
3911
|
+
}
|
|
3912
|
+
return startDir;
|
|
3913
|
+
}
|
|
3914
|
+
/**
|
|
3915
|
+
* Retrieves a list of files that have changed compared to the base branch or HEAD.
|
|
3916
|
+
* Handles both CI (GitHub Actions) and local development environments.
|
|
3917
|
+
* @param rootDir The root directory of the repository
|
|
3918
|
+
* @returns Array of relative file paths
|
|
3919
|
+
*/
|
|
3920
|
+
getChangedFiles(rootDir) {
|
|
3921
|
+
try {
|
|
3922
|
+
if (process.env.GITHUB_BASE_REF) {
|
|
3923
|
+
const baseRef = process.env.GITHUB_BASE_REF;
|
|
3924
|
+
if (!/^[\w./:-]+$/.test(baseRef)) {
|
|
3925
|
+
if (process.env.DEBUG) console.warn("GITHUB_BASE_REF contains unsafe characters; skipping CI diff.");
|
|
3926
|
+
return [];
|
|
3927
|
+
}
|
|
3928
|
+
try {
|
|
3929
|
+
(0, child_process.execFileSync)("git", [
|
|
3930
|
+
"fetch",
|
|
3931
|
+
"origin",
|
|
3932
|
+
baseRef,
|
|
3933
|
+
"--depth=1"
|
|
3934
|
+
], {
|
|
3935
|
+
cwd: rootDir,
|
|
3936
|
+
stdio: "ignore"
|
|
3937
|
+
});
|
|
3938
|
+
} catch {}
|
|
3939
|
+
return (0, child_process.execFileSync)("git", [
|
|
3940
|
+
"diff",
|
|
3941
|
+
"--name-only",
|
|
3942
|
+
`origin/${baseRef}...HEAD`
|
|
3943
|
+
], {
|
|
3944
|
+
cwd: rootDir,
|
|
3945
|
+
encoding: "utf8"
|
|
3946
|
+
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
3947
|
+
} else return (0, child_process.execSync)("git diff --name-only HEAD", {
|
|
3948
|
+
cwd: rootDir,
|
|
3949
|
+
encoding: "utf8"
|
|
3950
|
+
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
3951
|
+
} catch (error) {
|
|
3952
|
+
if (process.env.DEBUG) console.warn("Git failure while getting changed files:", error);
|
|
3953
|
+
return [];
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
/**
|
|
3957
|
+
* Retrieves a list of untracked files in the repository.
|
|
3958
|
+
* @param rootDir The root directory of the repository
|
|
3959
|
+
* @returns Array of relative file paths
|
|
3960
|
+
*/
|
|
3961
|
+
getUntrackedFiles(rootDir) {
|
|
3962
|
+
try {
|
|
3963
|
+
return (0, child_process.execSync)("git ls-files --others --exclude-standard", {
|
|
3964
|
+
cwd: rootDir,
|
|
3965
|
+
encoding: "utf8"
|
|
3966
|
+
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
3967
|
+
} catch (error) {
|
|
3968
|
+
if (process.env.DEBUG) console.warn("Git failure while getting untracked files:", error);
|
|
3969
|
+
return [];
|
|
3970
|
+
}
|
|
3971
|
+
}
|
|
3972
|
+
/**
|
|
3973
|
+
* Retrieves the URL of the 'origin' remote.
|
|
3974
|
+
* @param rootDir The root directory of the repository
|
|
3975
|
+
*/
|
|
3976
|
+
getRemoteUrl(rootDir) {
|
|
3977
|
+
try {
|
|
3978
|
+
return (0, child_process.execSync)("git remote get-url origin", {
|
|
3979
|
+
cwd: rootDir,
|
|
3980
|
+
encoding: "utf8"
|
|
3981
|
+
}).trim();
|
|
3982
|
+
} catch {
|
|
3983
|
+
return null;
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
};
|
|
3987
|
+
//#endregion
|
|
3890
3988
|
//#region src/services/utils/MarkdownUtils.ts
|
|
3891
3989
|
/**
|
|
3892
3990
|
* Utility functions for manipulating markdown content
|
|
@@ -3933,6 +4031,7 @@ var SyncService = class {
|
|
|
3933
4031
|
skillSyncService = new SkillSyncService(this.githubService);
|
|
3934
4032
|
workflowSyncService = new WorkflowSyncService(this.githubService);
|
|
3935
4033
|
specialistSyncService = new SpecialistSyncService();
|
|
4034
|
+
gitService = new GitService();
|
|
3936
4035
|
async reconcileConfig(config, projectDeps) {
|
|
3937
4036
|
const reenabled = this.configService.reconcileDependencies(config, projectDeps);
|
|
3938
4037
|
if (reenabled.length > 0) {
|
|
@@ -3946,8 +4045,19 @@ var SyncService = class {
|
|
|
3946
4045
|
return this.workflowSyncService.reconcileWorkflows(config);
|
|
3947
4046
|
}
|
|
3948
4047
|
async assembleSkills(categories, config) {
|
|
4048
|
+
await this.warnIfSyncingFromSameRepo(config);
|
|
3949
4049
|
return this.skillSyncService.assembleSkills(categories, config);
|
|
3950
4050
|
}
|
|
4051
|
+
async warnIfSyncingFromSameRepo(config) {
|
|
4052
|
+
const remoteUrl = this.gitService.getRemoteUrl(process.cwd());
|
|
4053
|
+
if (!remoteUrl) return;
|
|
4054
|
+
const remoteMatch = GithubService.parseGitHubUrl(remoteUrl);
|
|
4055
|
+
const registryMatch = GithubService.parseGitHubUrl(config.registry);
|
|
4056
|
+
if (remoteMatch && registryMatch && remoteMatch.owner === registryMatch.owner && remoteMatch.repo === registryMatch.repo) {
|
|
4057
|
+
console.log(picocolors.default.yellow(`\n⚠️ Note: You are syncing from the registry repository itself (${remoteMatch.owner}/${remoteMatch.repo}).`));
|
|
4058
|
+
console.log(picocolors.default.gray(` 'ags sync' pulls from GitHub. If you have unpushed local changes, they will be overwritten by the remote versions.`));
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
3951
4061
|
async writeSkills(skills, config) {
|
|
3952
4062
|
await this.cleanupOldFolders();
|
|
3953
4063
|
const agents = await this.resolveTargetAgents(config);
|
|
@@ -4243,7 +4353,7 @@ var SyncCommand = class {
|
|
|
4243
4353
|
};
|
|
4244
4354
|
var package_default = {
|
|
4245
4355
|
name: "agent-skills-standard",
|
|
4246
|
-
version: "2.2.
|
|
4356
|
+
version: "2.2.3",
|
|
4247
4357
|
description: "A CLI to manage and sync AI agent skills standard for Cursor, Claude, Copilot, Windsurf, and more.",
|
|
4248
4358
|
main: "dist/index.js",
|
|
4249
4359
|
bin: {
|
|
@@ -4382,83 +4492,6 @@ var UpgradeCommand = class {
|
|
|
4382
4492
|
}
|
|
4383
4493
|
};
|
|
4384
4494
|
//#endregion
|
|
4385
|
-
//#region src/services/GitService.ts
|
|
4386
|
-
/**
|
|
4387
|
-
* Service for handling Git operations within the project.
|
|
4388
|
-
* Provides a clean interface for querying changed and untracked files.
|
|
4389
|
-
*/
|
|
4390
|
-
var GitService = class {
|
|
4391
|
-
/**
|
|
4392
|
-
* Finds the root of the project by looking for .git or pnpm-workspace.yaml.
|
|
4393
|
-
*/
|
|
4394
|
-
findProjectRoot(startDir = process.cwd()) {
|
|
4395
|
-
let currentDir = startDir;
|
|
4396
|
-
while (currentDir !== path.default.parse(currentDir).root) {
|
|
4397
|
-
if (fs_extra.default.existsSync(path.default.join(currentDir, "pnpm-workspace.yaml")) || fs_extra.default.existsSync(path.default.join(currentDir, ".git"))) return currentDir;
|
|
4398
|
-
currentDir = path.default.dirname(currentDir);
|
|
4399
|
-
}
|
|
4400
|
-
return startDir;
|
|
4401
|
-
}
|
|
4402
|
-
/**
|
|
4403
|
-
* Retrieves a list of files that have changed compared to the base branch or HEAD.
|
|
4404
|
-
* Handles both CI (GitHub Actions) and local development environments.
|
|
4405
|
-
* @param rootDir The root directory of the repository
|
|
4406
|
-
* @returns Array of relative file paths
|
|
4407
|
-
*/
|
|
4408
|
-
getChangedFiles(rootDir) {
|
|
4409
|
-
try {
|
|
4410
|
-
if (process.env.GITHUB_BASE_REF) {
|
|
4411
|
-
const baseRef = process.env.GITHUB_BASE_REF;
|
|
4412
|
-
if (!/^[\w./:-]+$/.test(baseRef)) {
|
|
4413
|
-
if (process.env.DEBUG) console.warn("GITHUB_BASE_REF contains unsafe characters; skipping CI diff.");
|
|
4414
|
-
return [];
|
|
4415
|
-
}
|
|
4416
|
-
try {
|
|
4417
|
-
(0, child_process.execFileSync)("git", [
|
|
4418
|
-
"fetch",
|
|
4419
|
-
"origin",
|
|
4420
|
-
baseRef,
|
|
4421
|
-
"--depth=1"
|
|
4422
|
-
], {
|
|
4423
|
-
cwd: rootDir,
|
|
4424
|
-
stdio: "ignore"
|
|
4425
|
-
});
|
|
4426
|
-
} catch {}
|
|
4427
|
-
return (0, child_process.execFileSync)("git", [
|
|
4428
|
-
"diff",
|
|
4429
|
-
"--name-only",
|
|
4430
|
-
`origin/${baseRef}...HEAD`
|
|
4431
|
-
], {
|
|
4432
|
-
cwd: rootDir,
|
|
4433
|
-
encoding: "utf8"
|
|
4434
|
-
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
4435
|
-
} else return (0, child_process.execSync)("git diff --name-only HEAD", {
|
|
4436
|
-
cwd: rootDir,
|
|
4437
|
-
encoding: "utf8"
|
|
4438
|
-
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
4439
|
-
} catch (error) {
|
|
4440
|
-
if (process.env.DEBUG) console.warn("Git failure while getting changed files:", error);
|
|
4441
|
-
return [];
|
|
4442
|
-
}
|
|
4443
|
-
}
|
|
4444
|
-
/**
|
|
4445
|
-
* Retrieves a list of untracked files in the repository.
|
|
4446
|
-
* @param rootDir The root directory of the repository
|
|
4447
|
-
* @returns Array of relative file paths
|
|
4448
|
-
*/
|
|
4449
|
-
getUntrackedFiles(rootDir) {
|
|
4450
|
-
try {
|
|
4451
|
-
return (0, child_process.execSync)("git ls-files --others --exclude-standard", {
|
|
4452
|
-
cwd: rootDir,
|
|
4453
|
-
encoding: "utf8"
|
|
4454
|
-
}).split("\n").map((f) => f.trim()).filter((f) => f !== "" && fs_extra.default.existsSync(path.default.join(rootDir, f)));
|
|
4455
|
-
} catch (error) {
|
|
4456
|
-
if (process.env.DEBUG) console.warn("Git failure while getting untracked files:", error);
|
|
4457
|
-
return [];
|
|
4458
|
-
}
|
|
4459
|
-
}
|
|
4460
|
-
};
|
|
4461
|
-
//#endregion
|
|
4462
4495
|
//#region src/services/SkillDiscoveryService.ts
|
|
4463
4496
|
/**
|
|
4464
4497
|
* Service for discovering skill files within the repository.
|
|
@@ -4787,7 +4820,7 @@ var ValidateCommand = class {
|
|
|
4787
4820
|
//#region src/index.ts
|
|
4788
4821
|
dotenv.default.config();
|
|
4789
4822
|
var program = new commander.Command();
|
|
4790
|
-
program.name("agent-skills-standard").description("A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more.").version("2.2.
|
|
4823
|
+
program.name("agent-skills-standard").description("A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more.").version("2.2.3");
|
|
4791
4824
|
program.command("init").description("Initialize a .skillsrc configuration file interactively").action(async () => {
|
|
4792
4825
|
await new InitCommand().run();
|
|
4793
4826
|
});
|