agent-skills-standard 2.1.0 → 2.1.1
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 +47 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1875,11 +1875,23 @@ const INJECTION_PATTERNS = [
|
|
|
1875
1875
|
/<(?:script|iframe|style)[^>]*\s*>[\s\S]*?<\/(?:script|iframe|style)[^>]*\s*>/gi
|
|
1876
1876
|
];
|
|
1877
1877
|
class IndexGeneratorService {
|
|
1878
|
+
remoteMetadata;
|
|
1878
1879
|
/**
|
|
1879
|
-
*
|
|
1880
|
-
*
|
|
1880
|
+
* Injects registry metadata so index generation does not require metadata.json
|
|
1881
|
+
* to be present on disk. Returns `this` for chaining.
|
|
1882
|
+
*/
|
|
1883
|
+
withMetadata(metadata) {
|
|
1884
|
+
this.remoteMetadata = metadata;
|
|
1885
|
+
return this;
|
|
1886
|
+
}
|
|
1887
|
+
/**
|
|
1888
|
+
* Loads foundational composite rules. Uses injected remote metadata when available;
|
|
1889
|
+
* falls back to reading metadata.json from baseDir.
|
|
1881
1890
|
*/
|
|
1882
1891
|
async loadFoundationalRules(baseDir) {
|
|
1892
|
+
if (this.remoteMetadata?.foundational_composite_rules !== void 0) {
|
|
1893
|
+
return this.remoteMetadata.foundational_composite_rules;
|
|
1894
|
+
}
|
|
1883
1895
|
try {
|
|
1884
1896
|
const metaPath = path.join(baseDir, "metadata.json");
|
|
1885
1897
|
const raw = await fs.readFile(metaPath, "utf8");
|
|
@@ -1994,10 +2006,13 @@ ${entries.join("\n")}
|
|
|
1994
2006
|
`;
|
|
1995
2007
|
}
|
|
1996
2008
|
/**
|
|
1997
|
-
* Loads file routing rules
|
|
1998
|
-
*
|
|
2009
|
+
* Loads file routing rules. Uses injected remote metadata when available;
|
|
2010
|
+
* falls back to reading metadata.json from baseDir.
|
|
1999
2011
|
*/
|
|
2000
2012
|
async loadFileRouting(baseDir) {
|
|
2013
|
+
if (this.remoteMetadata?.file_routing !== void 0) {
|
|
2014
|
+
return this.remoteMetadata.file_routing;
|
|
2015
|
+
}
|
|
2001
2016
|
try {
|
|
2002
2017
|
const metaPath = path.join(baseDir, "metadata.json");
|
|
2003
2018
|
const raw = await fs.readFile(metaPath, "utf8");
|
|
@@ -2008,10 +2023,16 @@ ${entries.join("\n")}
|
|
|
2008
2023
|
}
|
|
2009
2024
|
}
|
|
2010
2025
|
/**
|
|
2011
|
-
* Loads broad glob patterns and base language skill mappings
|
|
2012
|
-
*
|
|
2026
|
+
* Loads broad glob patterns and base language skill mappings. Uses injected remote
|
|
2027
|
+
* metadata when available; falls back to reading metadata.json from baseDir.
|
|
2013
2028
|
*/
|
|
2014
2029
|
async loadTierConfig(baseDir) {
|
|
2030
|
+
if (this.remoteMetadata !== void 0) {
|
|
2031
|
+
return {
|
|
2032
|
+
broadGlobs: this.remoteMetadata.broad_globs ?? [],
|
|
2033
|
+
baseSkills: this.remoteMetadata.base_language_skills ?? {}
|
|
2034
|
+
};
|
|
2035
|
+
}
|
|
2015
2036
|
try {
|
|
2016
2037
|
const metaPath = path.join(baseDir, "metadata.json");
|
|
2017
2038
|
const raw = await fs.readFile(metaPath, "utf8");
|
|
@@ -2874,6 +2895,24 @@ class SyncService {
|
|
|
2874
2895
|
const generator = new IndexGeneratorService();
|
|
2875
2896
|
const baseDir = agentDef ? path.join(process.cwd(), agentDef.path) : path.join(process.cwd(), ".cursor/skills");
|
|
2876
2897
|
const allowedCategories = Object.keys(config.skills || {});
|
|
2898
|
+
const githubMatch = config.registry ? GithubService.parseGitHubUrl(config.registry) : null;
|
|
2899
|
+
if (githubMatch) {
|
|
2900
|
+
const { owner, repo } = githubMatch;
|
|
2901
|
+
const repoInfo = await this.githubService.getRepoInfo(owner, repo);
|
|
2902
|
+
const ref = repoInfo?.default_branch || "main";
|
|
2903
|
+
const metaRaw = await this.githubService.getRawFile(
|
|
2904
|
+
owner,
|
|
2905
|
+
repo,
|
|
2906
|
+
ref,
|
|
2907
|
+
"skills/metadata.json"
|
|
2908
|
+
);
|
|
2909
|
+
if (metaRaw) {
|
|
2910
|
+
try {
|
|
2911
|
+
generator.withMetadata(JSON.parse(metaRaw));
|
|
2912
|
+
} catch {
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2877
2916
|
const categoryIndices = await generator.generateAllCategoryIndices(
|
|
2878
2917
|
baseDir,
|
|
2879
2918
|
allowedCategories
|
|
@@ -3043,7 +3082,7 @@ class SyncCommand {
|
|
|
3043
3082
|
}
|
|
3044
3083
|
}
|
|
3045
3084
|
}
|
|
3046
|
-
const version = "2.1.
|
|
3085
|
+
const version = "2.1.1";
|
|
3047
3086
|
const pkg = {
|
|
3048
3087
|
version
|
|
3049
3088
|
};
|
|
@@ -3561,7 +3600,7 @@ dotenv.config();
|
|
|
3561
3600
|
const program = new commander.Command();
|
|
3562
3601
|
program.name("agent-skills-standard").description(
|
|
3563
3602
|
"A CLI to manage and sync AI agent skills for Cursor, Claude, Copilot, Windsurf, and more."
|
|
3564
|
-
).version("2.1.
|
|
3603
|
+
).version("2.1.1");
|
|
3565
3604
|
program.command("init").description("Initialize a .skillsrc configuration file interactively").action(async () => {
|
|
3566
3605
|
const init = new InitCommand();
|
|
3567
3606
|
await init.run();
|