skilld 2.2.0 → 3.0.0-beta.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/README.md +106 -366
- package/bin/skilld.mjs +56 -0
- package/loader/resolve-artifact.mjs +37 -0
- package/package.json +23 -53
- package/dist/_chunks/add.mjs +0 -67
- package/dist/_chunks/add.mjs.map +0 -1
- package/dist/_chunks/agent-prompt.mjs +0 -88
- package/dist/_chunks/agent-prompt.mjs.map +0 -1
- package/dist/_chunks/agent.mjs +0 -1817
- package/dist/_chunks/agent.mjs.map +0 -1
- package/dist/_chunks/args.mjs +0 -42
- package/dist/_chunks/args.mjs.map +0 -1
- package/dist/_chunks/assemble.mjs +0 -126
- package/dist/_chunks/assemble.mjs.map +0 -1
- package/dist/_chunks/author.mjs +0 -432
- package/dist/_chunks/author.mjs.map +0 -1
- package/dist/_chunks/cache.mjs +0 -367
- package/dist/_chunks/cache.mjs.map +0 -1
- package/dist/_chunks/cache2.mjs +0 -151
- package/dist/_chunks/cache2.mjs.map +0 -1
- package/dist/_chunks/client.mjs +0 -118
- package/dist/_chunks/client.mjs.map +0 -1
- package/dist/_chunks/core.mjs +0 -13
- package/dist/_chunks/detect.mjs +0 -609
- package/dist/_chunks/detect.mjs.map +0 -1
- package/dist/_chunks/detect2.mjs +0 -2
- package/dist/_chunks/eject.mjs +0 -69
- package/dist/_chunks/eject.mjs.map +0 -1
- package/dist/_chunks/embedding-cache.mjs +0 -2
- package/dist/_chunks/embedding-cache2.mjs +0 -61
- package/dist/_chunks/embedding-cache2.mjs.map +0 -1
- package/dist/_chunks/env.mjs +0 -19
- package/dist/_chunks/env.mjs.map +0 -1
- package/dist/_chunks/index-identity.mjs +0 -365
- package/dist/_chunks/index-identity.mjs.map +0 -1
- package/dist/_chunks/index-identity2.mjs +0 -2
- package/dist/_chunks/install-many.mjs +0 -378
- package/dist/_chunks/install-many.mjs.map +0 -1
- package/dist/_chunks/install.mjs +0 -259
- package/dist/_chunks/install.mjs.map +0 -1
- package/dist/_chunks/intro.mjs +0 -63
- package/dist/_chunks/intro.mjs.map +0 -1
- package/dist/_chunks/list.mjs +0 -102
- package/dist/_chunks/list.mjs.map +0 -1
- package/dist/_chunks/lockfile.mjs +0 -174
- package/dist/_chunks/lockfile.mjs.map +0 -1
- package/dist/_chunks/login.mjs +0 -234
- package/dist/_chunks/login.mjs.map +0 -1
- package/dist/_chunks/logout.mjs +0 -27
- package/dist/_chunks/logout.mjs.map +0 -1
- package/dist/_chunks/map.mjs +0 -11
- package/dist/_chunks/map.mjs.map +0 -1
- package/dist/_chunks/markdown.mjs +0 -101
- package/dist/_chunks/markdown.mjs.map +0 -1
- package/dist/_chunks/menu.mjs +0 -33
- package/dist/_chunks/menu.mjs.map +0 -1
- package/dist/_chunks/model-picker.mjs +0 -61
- package/dist/_chunks/model-picker.mjs.map +0 -1
- package/dist/_chunks/monorepo.mjs +0 -74
- package/dist/_chunks/monorepo.mjs.map +0 -1
- package/dist/_chunks/package-json.mjs +0 -84
- package/dist/_chunks/package-json.mjs.map +0 -1
- package/dist/_chunks/paths.mjs +0 -47
- package/dist/_chunks/paths.mjs.map +0 -1
- package/dist/_chunks/pipeline.mjs +0 -993
- package/dist/_chunks/pipeline.mjs.map +0 -1
- package/dist/_chunks/pool.mjs +0 -2
- package/dist/_chunks/pool2.mjs +0 -121
- package/dist/_chunks/pool2.mjs.map +0 -1
- package/dist/_chunks/portable.mjs +0 -152
- package/dist/_chunks/portable.mjs.map +0 -1
- package/dist/_chunks/prepare-hook.mjs +0 -2
- package/dist/_chunks/prepare-hook2.mjs +0 -61
- package/dist/_chunks/prepare-hook2.mjs.map +0 -1
- package/dist/_chunks/prepare.mjs +0 -105
- package/dist/_chunks/prepare.mjs.map +0 -1
- package/dist/_chunks/prepare2.mjs +0 -80
- package/dist/_chunks/prepare2.mjs.map +0 -1
- package/dist/_chunks/prompts.mjs +0 -1252
- package/dist/_chunks/prompts.mjs.map +0 -1
- package/dist/_chunks/pull.mjs +0 -220
- package/dist/_chunks/pull.mjs.map +0 -1
- package/dist/_chunks/regex.mjs +0 -19
- package/dist/_chunks/regex.mjs.map +0 -1
- package/dist/_chunks/retriv.mjs +0 -2
- package/dist/_chunks/retriv2.mjs +0 -177
- package/dist/_chunks/retriv2.mjs.map +0 -1
- package/dist/_chunks/sanitize.mjs +0 -260
- package/dist/_chunks/sanitize.mjs.map +0 -1
- package/dist/_chunks/search-helpers.mjs +0 -100
- package/dist/_chunks/search-helpers.mjs.map +0 -1
- package/dist/_chunks/search-interactive.mjs +0 -249
- package/dist/_chunks/search-interactive.mjs.map +0 -1
- package/dist/_chunks/search.mjs +0 -219
- package/dist/_chunks/search.mjs.map +0 -1
- package/dist/_chunks/semver.mjs +0 -2801
- package/dist/_chunks/semver.mjs.map +0 -1
- package/dist/_chunks/skill-installer.mjs +0 -2
- package/dist/_chunks/skill-installer2.mjs +0 -163
- package/dist/_chunks/skill-installer2.mjs.map +0 -1
- package/dist/_chunks/skills.mjs +0 -178
- package/dist/_chunks/skills.mjs.map +0 -1
- package/dist/_chunks/store.mjs +0 -107
- package/dist/_chunks/store.mjs.map +0 -1
- package/dist/_chunks/sync.mjs +0 -1009
- package/dist/_chunks/sync.mjs.map +0 -1
- package/dist/_chunks/sync2.mjs +0 -2
- package/dist/_chunks/telemetry.mjs +0 -26
- package/dist/_chunks/telemetry.mjs.map +0 -1
- package/dist/_chunks/uninstall.mjs +0 -214
- package/dist/_chunks/uninstall.mjs.map +0 -1
- package/dist/_chunks/update.mjs +0 -172
- package/dist/_chunks/update.mjs.map +0 -1
- package/dist/_chunks/upload.mjs +0 -155
- package/dist/_chunks/upload.mjs.map +0 -1
- package/dist/_chunks/validate.mjs +0 -60
- package/dist/_chunks/validate.mjs.map +0 -1
- package/dist/_chunks/version.mjs +0 -19
- package/dist/_chunks/version.mjs.map +0 -1
- package/dist/_chunks/whoami.mjs +0 -21
- package/dist/_chunks/whoami.mjs.map +0 -1
- package/dist/_chunks/wizard.mjs +0 -2
- package/dist/_chunks/wizard2.mjs +0 -200
- package/dist/_chunks/wizard2.mjs.map +0 -1
- package/dist/_chunks/yaml.mjs +0 -33
- package/dist/_chunks/yaml.mjs.map +0 -1
- package/dist/cli-entry.d.mts +0 -1
- package/dist/cli-entry.mjs +0 -5
- package/dist/cli-entry.mjs.map +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.mjs +0 -1314
- package/dist/cli.mjs.map +0 -1
- package/dist/prepare.d.mts +0 -1
- package/dist/prepare.mjs +0 -84
- package/dist/prepare.mjs.map +0 -1
- package/dist/retriv/worker.d.mts +0 -37
- package/dist/retriv/worker.d.mts.map +0 -1
- package/dist/retriv/worker.mjs +0 -46
- package/dist/retriv/worker.mjs.map +0 -1
package/dist/_chunks/detect.mjs
DELETED
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
2
|
-
import { join } from "pathe";
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
|
-
import { isWindows } from "std-env";
|
|
5
|
-
import { homedir } from "node:os";
|
|
6
|
-
const SPEC_FRONTMATTER = {
|
|
7
|
-
"name": {
|
|
8
|
-
name: "name",
|
|
9
|
-
required: true,
|
|
10
|
-
description: "Skill identifier. Must match parent directory name.",
|
|
11
|
-
constraints: "1-64 chars, lowercase alphanumeric + hyphens"
|
|
12
|
-
},
|
|
13
|
-
"description": {
|
|
14
|
-
name: "description",
|
|
15
|
-
required: true,
|
|
16
|
-
description: "What the skill does and when to use it.",
|
|
17
|
-
constraints: "1-1024 chars"
|
|
18
|
-
},
|
|
19
|
-
"license": {
|
|
20
|
-
name: "license",
|
|
21
|
-
required: false,
|
|
22
|
-
description: "License reference"
|
|
23
|
-
},
|
|
24
|
-
"compatibility": {
|
|
25
|
-
name: "compatibility",
|
|
26
|
-
required: false,
|
|
27
|
-
description: "Environment requirements",
|
|
28
|
-
constraints: "max 500 chars"
|
|
29
|
-
},
|
|
30
|
-
"metadata": {
|
|
31
|
-
name: "metadata",
|
|
32
|
-
required: false,
|
|
33
|
-
description: "Arbitrary key-value pairs"
|
|
34
|
-
},
|
|
35
|
-
"allowed-tools": {
|
|
36
|
-
name: "allowed-tools",
|
|
37
|
-
required: false,
|
|
38
|
-
description: "Space-delimited pre-approved tools (experimental)"
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const BASE_DEFAULTS = {
|
|
42
|
-
skillFilename: "SKILL.md",
|
|
43
|
-
nameMatchesDir: true,
|
|
44
|
-
namePattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
|
|
45
|
-
additionalSkillsDirs: [],
|
|
46
|
-
extensions: [],
|
|
47
|
-
notes: []
|
|
48
|
-
};
|
|
49
|
-
function defineTarget(target) {
|
|
50
|
-
const { globalSkillsDir, additionalSkillsDirs, ...rest } = target;
|
|
51
|
-
const additional = additionalSkillsDirs ?? BASE_DEFAULTS.additionalSkillsDirs;
|
|
52
|
-
return {
|
|
53
|
-
...BASE_DEFAULTS,
|
|
54
|
-
...rest,
|
|
55
|
-
get globalSkillsDir() {
|
|
56
|
-
return globalSkillsDir();
|
|
57
|
-
},
|
|
58
|
-
get additionalSkillsDirs() {
|
|
59
|
-
return typeof additional === "function" ? additional() : additional;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const configHome$2 = () => process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
64
|
-
const amp = defineTarget({
|
|
65
|
-
agent: "amp",
|
|
66
|
-
displayName: "Amp",
|
|
67
|
-
detectInstalled: () => existsSync(join(configHome$2(), "amp")),
|
|
68
|
-
detectEnv: () => !!process.env.AMP_SESSION,
|
|
69
|
-
detectProject: (cwd) => existsSync(join(cwd, ".agents", "AGENTS.md")),
|
|
70
|
-
instructionFile: "AGENTS.md",
|
|
71
|
-
skillsDir: ".agents/skills",
|
|
72
|
-
globalSkillsDir: () => join(configHome$2(), "agents/skills"),
|
|
73
|
-
additionalSkillsDirs: [
|
|
74
|
-
".claude/skills",
|
|
75
|
-
"~/.config/amp/skills",
|
|
76
|
-
"~/.claude/skills"
|
|
77
|
-
],
|
|
78
|
-
frontmatter: [{
|
|
79
|
-
...SPEC_FRONTMATTER.name,
|
|
80
|
-
description: "Unique identifier. Project skills override user-wide ones with same name."
|
|
81
|
-
}, {
|
|
82
|
-
...SPEC_FRONTMATTER.description,
|
|
83
|
-
description: "Always visible to the model; determines when skill is invoked."
|
|
84
|
-
}],
|
|
85
|
-
discoveryStrategy: "lazy",
|
|
86
|
-
discoveryNotes: "Names + descriptions visible at startup. Full SKILL.md body loads only when agent decides to invoke based on description match.",
|
|
87
|
-
agentSkillsSpec: false,
|
|
88
|
-
extensions: ["mcp.json for bundling MCP server configurations"],
|
|
89
|
-
docs: "https://ampcode.com/news/agent-skills",
|
|
90
|
-
notes: [
|
|
91
|
-
"Reads .claude/skills/ natively — emitting there covers Claude Code, Cursor, Cline, Copilot, AND Amp.",
|
|
92
|
-
"Skills can bundle MCP servers via mcp.json in the skill directory.",
|
|
93
|
-
"AGENTS.md supports @-mentions to reference files (e.g. @doc/style.md, @doc/*.md globs).",
|
|
94
|
-
"AGENTS.md files with globs frontmatter are conditionally included only when Amp reads matching files."
|
|
95
|
-
]
|
|
96
|
-
});
|
|
97
|
-
const home$6 = () => homedir();
|
|
98
|
-
const antigravity = defineTarget({
|
|
99
|
-
agent: "antigravity",
|
|
100
|
-
displayName: "Antigravity",
|
|
101
|
-
detectInstalled: () => existsSync(join(home$6(), ".gemini/antigravity")),
|
|
102
|
-
detectEnv: () => !!process.env.ANTIGRAVITY_CLI_ALIAS,
|
|
103
|
-
detectProject: (cwd) => existsSync(join(cwd, ".agent")),
|
|
104
|
-
instructionFile: "GEMINI.md",
|
|
105
|
-
skillsDir: ".agent/skills",
|
|
106
|
-
globalSkillsDir: () => join(home$6(), ".gemini/antigravity/skills"),
|
|
107
|
-
frontmatter: [{
|
|
108
|
-
...SPEC_FRONTMATTER.name,
|
|
109
|
-
description: "Skill identifier. Defaults to directory name if omitted."
|
|
110
|
-
}, {
|
|
111
|
-
...SPEC_FRONTMATTER.description,
|
|
112
|
-
description: "Semantic trigger for agent routing. Must be descriptive enough for LLM matching."
|
|
113
|
-
}],
|
|
114
|
-
discoveryStrategy: "lazy",
|
|
115
|
-
discoveryNotes: "Indexes name + description at startup. Full SKILL.md body loads on demand when agent semantic-matches description against user prompt.",
|
|
116
|
-
agentSkillsSpec: true,
|
|
117
|
-
docs: "https://antigravity.google/docs/skills",
|
|
118
|
-
notes: [
|
|
119
|
-
"Only `name` and `description` are used for routing; other frontmatter fields are accepted but not used for matching.",
|
|
120
|
-
"Skill directories can include scripts/, resources/, and assets/ subdirectories for supporting files.",
|
|
121
|
-
"GEMINI.md instruction file is shared with Gemini CLI. .agent/rules/*.md for always-on workspace rules."
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
const claudeHome = () => process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
125
|
-
const claudeCode = defineTarget({
|
|
126
|
-
agent: "claude-code",
|
|
127
|
-
displayName: "Claude Code",
|
|
128
|
-
detectInstalled: () => existsSync(claudeHome()),
|
|
129
|
-
detectEnv: () => !!(process.env.CLAUDE_CODE || process.env.CLAUDECODE || process.env.CLAUDE_CODE_ENTRYPOINT || process.env.CLAUDE_CONFIG_DIR),
|
|
130
|
-
detectProject: (cwd) => {
|
|
131
|
-
if (existsSync(join(cwd, ".claude", "settings.json"))) return true;
|
|
132
|
-
if (existsSync(join(cwd, ".claude", "settings.local.json"))) return true;
|
|
133
|
-
if (existsSync(join(cwd, ".claude", "skills"))) return true;
|
|
134
|
-
return existsSync(join(cwd, ".claude"));
|
|
135
|
-
},
|
|
136
|
-
cli: "claude",
|
|
137
|
-
instructionFile: "CLAUDE.md",
|
|
138
|
-
skillsDir: ".claude/skills",
|
|
139
|
-
globalSkillsDir: () => join(claudeHome(), "skills"),
|
|
140
|
-
frontmatter: [
|
|
141
|
-
{
|
|
142
|
-
...SPEC_FRONTMATTER.name,
|
|
143
|
-
required: false,
|
|
144
|
-
description: "Skill identifier, becomes /slash-command. Defaults to directory name if omitted.",
|
|
145
|
-
constraints: "1-64 chars, ^[a-z0-9]+(-[a-z0-9]+)*$"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
...SPEC_FRONTMATTER.description,
|
|
149
|
-
description: "What the skill does and when to use it. Used for auto-discovery matching."
|
|
150
|
-
},
|
|
151
|
-
SPEC_FRONTMATTER.license,
|
|
152
|
-
SPEC_FRONTMATTER.compatibility,
|
|
153
|
-
SPEC_FRONTMATTER.metadata,
|
|
154
|
-
SPEC_FRONTMATTER["allowed-tools"],
|
|
155
|
-
{
|
|
156
|
-
name: "disable-model-invocation",
|
|
157
|
-
required: false,
|
|
158
|
-
description: "When true, skill only loads via explicit /name invocation"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "user-invocable",
|
|
162
|
-
required: false,
|
|
163
|
-
description: "When false, hides from / menu but still auto-loads"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: "argument-hint",
|
|
167
|
-
required: false,
|
|
168
|
-
description: "Hint shown during autocomplete, e.g. [issue-number]"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: "model",
|
|
172
|
-
required: false,
|
|
173
|
-
description: "Model to use when skill is active"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: "context",
|
|
177
|
-
required: false,
|
|
178
|
-
description: "Set to \"fork\" to run in a forked subagent context"
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
name: "agent",
|
|
182
|
-
required: false,
|
|
183
|
-
description: "Subagent type when context: fork (e.g. Explore, Plan)"
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
discoveryStrategy: "eager",
|
|
187
|
-
discoveryNotes: "Scans skill dirs at startup, reads name + description only. Full body loads on invocation. Budget: 2% of context window for all skill descriptions.",
|
|
188
|
-
agentSkillsSpec: true,
|
|
189
|
-
extensions: [
|
|
190
|
-
"disable-model-invocation",
|
|
191
|
-
"user-invocable",
|
|
192
|
-
"argument-hint",
|
|
193
|
-
"model",
|
|
194
|
-
"context",
|
|
195
|
-
"agent",
|
|
196
|
-
"hooks",
|
|
197
|
-
"$ARGUMENTS substitution",
|
|
198
|
-
"!`command` dynamic context"
|
|
199
|
-
],
|
|
200
|
-
docs: "https://code.claude.com/docs/en/skills",
|
|
201
|
-
notes: [
|
|
202
|
-
"`globs` is NOT a valid frontmatter field for skills (only for rules). Unknown fields are silently ignored.",
|
|
203
|
-
"`version` and `generated_by` should go under `metadata` map, not as top-level fields.",
|
|
204
|
-
"Skill descriptions have a char budget of 2% of context window (~16k chars fallback). Override with SLASH_COMMAND_TOOL_CHAR_BUDGET env var.",
|
|
205
|
-
"Keep SKILL.md under 500 lines. Move detailed reference to separate files.",
|
|
206
|
-
"Supports monorepo auto-discovery: nested .claude/skills/ dirs in subdirectories.",
|
|
207
|
-
"Supporting dirs: scripts/, references/, assets/ alongside SKILL.md.",
|
|
208
|
-
"Project detection uses weighted signals: .claude/settings.json, .claude/settings.local.json, .claude/skills/ are strong; bare .claude/ is medium; CLAUDE.md alone is not checked (too many false positives from repo conventions)."
|
|
209
|
-
]
|
|
210
|
-
});
|
|
211
|
-
const home$5 = () => homedir();
|
|
212
|
-
const cline = defineTarget({
|
|
213
|
-
agent: "cline",
|
|
214
|
-
displayName: "Cline",
|
|
215
|
-
detectInstalled: () => existsSync(join(home$5(), ".cline")),
|
|
216
|
-
detectEnv: () => !!(process.env.CLINE_TASK_ID || process.env.CLINE_ACTIVE),
|
|
217
|
-
detectProject: (cwd) => existsSync(join(cwd, ".cline")),
|
|
218
|
-
instructionFile: ".clinerules",
|
|
219
|
-
skillsDir: ".cline/skills",
|
|
220
|
-
globalSkillsDir: () => join(home$5(), ".cline/skills"),
|
|
221
|
-
additionalSkillsDirs: [".clinerules/skills", ".claude/skills"],
|
|
222
|
-
frontmatter: [{
|
|
223
|
-
...SPEC_FRONTMATTER.name,
|
|
224
|
-
description: "Must exactly match the directory name."
|
|
225
|
-
}, {
|
|
226
|
-
...SPEC_FRONTMATTER.description,
|
|
227
|
-
description: "When to activate. Used for matching."
|
|
228
|
-
}],
|
|
229
|
-
discoveryStrategy: "eager",
|
|
230
|
-
discoveryNotes: "At startup reads name + description from each skill. Full content loads on-demand via use_skill tool. Dozens of skills have near-zero context cost.",
|
|
231
|
-
agentSkillsSpec: false,
|
|
232
|
-
docs: "https://docs.cline.bot/features/skills",
|
|
233
|
-
notes: [
|
|
234
|
-
"Only `name` and `description` are parsed. `version`, `globs`, etc. are silently ignored.",
|
|
235
|
-
"Cline reads .claude/skills/ as a fallback — emitting there covers both Claude Code and Cline.",
|
|
236
|
-
"Rules system (.clinerules/) is separate: always-on behavioral constraints with globs/tags frontmatter.",
|
|
237
|
-
"Global skills override project skills when names conflict.",
|
|
238
|
-
"Supporting dirs: docs/, scripts/, templates/ alongside SKILL.md."
|
|
239
|
-
]
|
|
240
|
-
});
|
|
241
|
-
const codexHome = () => process.env.CODEX_HOME || join(homedir(), ".codex");
|
|
242
|
-
const codex = defineTarget({
|
|
243
|
-
agent: "codex",
|
|
244
|
-
displayName: "Codex",
|
|
245
|
-
detectInstalled: () => existsSync(codexHome()),
|
|
246
|
-
detectEnv: () => false,
|
|
247
|
-
detectProject: (cwd) => existsSync(join(cwd, ".codex")) || existsSync(join(cwd, "AGENTS.md")) || existsSync(join(cwd, "AGENTS.override.md")) || existsSync(join(cwd, ".agents", "skills")),
|
|
248
|
-
cli: "codex",
|
|
249
|
-
instructionFile: "AGENTS.md",
|
|
250
|
-
skillsDir: ".agents/skills",
|
|
251
|
-
globalSkillsDir: () => join(homedir(), ".agents/skills"),
|
|
252
|
-
additionalSkillsDirs: ["~/.codex/skills", "/etc/codex/skills"],
|
|
253
|
-
frontmatter: [
|
|
254
|
-
{
|
|
255
|
-
...SPEC_FRONTMATTER.name,
|
|
256
|
-
description: "Skill identifier.",
|
|
257
|
-
constraints: "1-64 chars, ^[a-z0-9-]+$, no leading/trailing/consecutive hyphens"
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
...SPEC_FRONTMATTER.description,
|
|
261
|
-
description: "Must include when-to-use criteria. Primary triggering mechanism.",
|
|
262
|
-
constraints: "1-1024 chars, no angle brackets (< or >)"
|
|
263
|
-
},
|
|
264
|
-
SPEC_FRONTMATTER.license,
|
|
265
|
-
SPEC_FRONTMATTER["allowed-tools"],
|
|
266
|
-
SPEC_FRONTMATTER.metadata
|
|
267
|
-
],
|
|
268
|
-
discoveryStrategy: "lazy",
|
|
269
|
-
discoveryNotes: "Startup scan reads name + description + optional agents/openai.yaml. Full body loads only on invocation. Supports $1-$9 and $ARGUMENTS placeholders.",
|
|
270
|
-
agentSkillsSpec: true,
|
|
271
|
-
extensions: [
|
|
272
|
-
"agents/openai.yaml (UI metadata + MCP dependencies)",
|
|
273
|
-
"$1-$9 positional argument placeholders",
|
|
274
|
-
"AGENTS.override.md for temporary overrides"
|
|
275
|
-
],
|
|
276
|
-
skillActivationHint: "Before modifying code, check .agents/skills/ for relevant skills.\nRead the SKILL.md for any matching package before proceeding.",
|
|
277
|
-
docs: "https://developers.openai.com/codex/skills",
|
|
278
|
-
notes: [
|
|
279
|
-
"Description field cannot contain angle brackets (< or >).",
|
|
280
|
-
"Optional agents/openai.yaml provides UI metadata: display_name, icon, brand_color, default_prompt.",
|
|
281
|
-
"AGENTS.md walks from git root to CWD, concatenating all found files.",
|
|
282
|
-
"Live reload: detects skill file changes without restart (v0.95.0+).",
|
|
283
|
-
"Size limit: 32 KiB default (project_doc_max_bytes), configurable in ~/.codex/config.toml."
|
|
284
|
-
]
|
|
285
|
-
});
|
|
286
|
-
const home$4 = () => homedir();
|
|
287
|
-
const cursor = defineTarget({
|
|
288
|
-
agent: "cursor",
|
|
289
|
-
displayName: "Cursor",
|
|
290
|
-
detectInstalled: () => existsSync(join(home$4(), ".cursor")),
|
|
291
|
-
detectEnv: () => !!(process.env.CURSOR_SESSION || process.env.CURSOR_TRACE_ID),
|
|
292
|
-
detectProject: (cwd) => existsSync(join(cwd, ".cursor")) || existsSync(join(cwd, ".cursorrules")),
|
|
293
|
-
instructionFile: ".cursor/rules/skilld-activation.mdc",
|
|
294
|
-
skillsDir: ".cursor/skills",
|
|
295
|
-
globalSkillsDir: () => join(home$4(), ".cursor/skills"),
|
|
296
|
-
additionalSkillsDirs: [
|
|
297
|
-
".claude/skills",
|
|
298
|
-
".codex/skills",
|
|
299
|
-
"~/.claude/skills",
|
|
300
|
-
"~/.codex/skills"
|
|
301
|
-
],
|
|
302
|
-
frontmatter: [
|
|
303
|
-
SPEC_FRONTMATTER.name,
|
|
304
|
-
{
|
|
305
|
-
...SPEC_FRONTMATTER.description,
|
|
306
|
-
description: "Agent uses this to decide relevance for auto-invocation."
|
|
307
|
-
},
|
|
308
|
-
SPEC_FRONTMATTER.license,
|
|
309
|
-
SPEC_FRONTMATTER.compatibility,
|
|
310
|
-
SPEC_FRONTMATTER.metadata,
|
|
311
|
-
{
|
|
312
|
-
name: "disable-model-invocation",
|
|
313
|
-
required: false,
|
|
314
|
-
description: "When true, only loads via explicit /skill-name"
|
|
315
|
-
}
|
|
316
|
-
],
|
|
317
|
-
discoveryStrategy: "lazy",
|
|
318
|
-
discoveryNotes: "Reads name + description at conversation start. Full SKILL.md body loads only when agent determines relevance. Users can also invoke via /skill-name.",
|
|
319
|
-
agentSkillsSpec: true,
|
|
320
|
-
extensions: ["disable-model-invocation"],
|
|
321
|
-
skillActivationHint: "Before modifying code, evaluate each installed skill against the current task.\nFor each skill, determine YES/NO relevance and invoke all YES skills before proceeding.",
|
|
322
|
-
docs: "https://cursor.com/docs/context/skills",
|
|
323
|
-
notes: [
|
|
324
|
-
"Cursor scans .claude/skills/ and .codex/skills/ natively — emitting to .claude/skills/ covers both Claude Code and Cursor.",
|
|
325
|
-
"The Rules system (.cursor/rules/*.mdc) is separate and uses different frontmatter (trigger, globs, alwaysApply).",
|
|
326
|
-
"Skills appear in Settings > Rules > Agent Decides section.",
|
|
327
|
-
"Supporting dirs: scripts/, references/, assets/ alongside SKILL.md."
|
|
328
|
-
]
|
|
329
|
-
});
|
|
330
|
-
const home$3 = () => homedir();
|
|
331
|
-
const geminiCli = defineTarget({
|
|
332
|
-
agent: "gemini-cli",
|
|
333
|
-
displayName: "Gemini CLI",
|
|
334
|
-
detectInstalled: () => existsSync(join(home$3(), ".gemini")),
|
|
335
|
-
detectEnv: () => !!process.env.GEMINI_CLI,
|
|
336
|
-
detectProject: (cwd) => existsSync(join(cwd, ".gemini")),
|
|
337
|
-
cli: "gemini",
|
|
338
|
-
instructionFile: "GEMINI.md",
|
|
339
|
-
skillsDir: ".gemini/skills",
|
|
340
|
-
globalSkillsDir: () => join(home$3(), ".gemini/skills"),
|
|
341
|
-
additionalSkillsDirs: () => [".agents/skills", join(home$3(), ".agents/skills")],
|
|
342
|
-
frontmatter: [
|
|
343
|
-
SPEC_FRONTMATTER.name,
|
|
344
|
-
{
|
|
345
|
-
...SPEC_FRONTMATTER.description,
|
|
346
|
-
description: "Primary trigger — agent uses this to match tasks."
|
|
347
|
-
},
|
|
348
|
-
SPEC_FRONTMATTER.license,
|
|
349
|
-
SPEC_FRONTMATTER.compatibility,
|
|
350
|
-
SPEC_FRONTMATTER.metadata,
|
|
351
|
-
SPEC_FRONTMATTER["allowed-tools"]
|
|
352
|
-
],
|
|
353
|
-
discoveryStrategy: "eager",
|
|
354
|
-
discoveryNotes: "Scans at session start, injects ~100 tokens per skill (name+description). Activation via activate_skill tool requires user confirmation. Skill stays active for session duration.",
|
|
355
|
-
agentSkillsSpec: true,
|
|
356
|
-
skillActivationHint: "Before modifying code, check installed skills for relevant guidance.\nUse `activate_skill` to load any matching skill before proceeding.",
|
|
357
|
-
docs: "https://geminicli.com/docs/cli/skills/",
|
|
358
|
-
notes: [
|
|
359
|
-
"Management commands: /skills list, /skills enable <name>, /skills disable <name>, /skills reload.",
|
|
360
|
-
"GEMINI.md context files are separate from skills — support @file.md import syntax.",
|
|
361
|
-
"settings.json can configure additional context filenames: [\"AGENTS.md\", \"CONTEXT.md\", \"GEMINI.md\"].",
|
|
362
|
-
"scripts/, references/, assets/ directories are defined by spec but implementation is still incomplete (issue #15895).",
|
|
363
|
-
"Also scans .agents/skills/ (Agent Skills spec standard) - skilld deduplicates to avoid conflicts."
|
|
364
|
-
]
|
|
365
|
-
});
|
|
366
|
-
const home$2 = () => homedir();
|
|
367
|
-
function hasCopilotExtension() {
|
|
368
|
-
const h = home$2();
|
|
369
|
-
const extDirs = [
|
|
370
|
-
join(h, ".vscode", "extensions"),
|
|
371
|
-
join(h, ".vscode-server", "extensions"),
|
|
372
|
-
join(h, ".cursor", "extensions")
|
|
373
|
-
];
|
|
374
|
-
for (const dir of extDirs) {
|
|
375
|
-
if (!existsSync(dir)) continue;
|
|
376
|
-
try {
|
|
377
|
-
if (readdirSync(dir).some((e) => e.startsWith("github.copilot-"))) return true;
|
|
378
|
-
} catch {}
|
|
379
|
-
}
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
const githubCopilot = defineTarget({
|
|
383
|
-
agent: "github-copilot",
|
|
384
|
-
displayName: "GitHub Copilot",
|
|
385
|
-
detectInstalled: () => existsSync(join(home$2(), ".copilot")) || hasCopilotExtension(),
|
|
386
|
-
detectEnv: () => !!process.env.COPILOT_RUN_APP,
|
|
387
|
-
detectProject: (cwd) => existsSync(join(cwd, ".github", "copilot-instructions.md")) || existsSync(join(cwd, ".github", "skills")) || existsSync(join(cwd, "AGENTS.md")) || existsSync(join(cwd, ".github", "instructions")),
|
|
388
|
-
instructionFile: ".github/copilot-instructions.md",
|
|
389
|
-
skillsDir: ".github/skills",
|
|
390
|
-
globalSkillsDir: () => join(home$2(), ".copilot/skills"),
|
|
391
|
-
additionalSkillsDirs: [".claude/skills", "~/.claude/skills"],
|
|
392
|
-
frontmatter: [
|
|
393
|
-
SPEC_FRONTMATTER.name,
|
|
394
|
-
{
|
|
395
|
-
...SPEC_FRONTMATTER.description,
|
|
396
|
-
description: "What the skill does AND when to use it."
|
|
397
|
-
},
|
|
398
|
-
SPEC_FRONTMATTER.license,
|
|
399
|
-
SPEC_FRONTMATTER.compatibility,
|
|
400
|
-
{
|
|
401
|
-
...SPEC_FRONTMATTER.metadata,
|
|
402
|
-
description: "Arbitrary key-value pairs (e.g. version, author)"
|
|
403
|
-
},
|
|
404
|
-
SPEC_FRONTMATTER["allowed-tools"]
|
|
405
|
-
],
|
|
406
|
-
discoveryStrategy: "lazy",
|
|
407
|
-
discoveryNotes: "3-level progressive disclosure: (1) ~100 tokens for name+description, (2) full SKILL.md body <5000 tokens on activation, (3) resources from scripts/references/assets/ on demand.",
|
|
408
|
-
agentSkillsSpec: true,
|
|
409
|
-
skillActivationHint: "Before modifying code, evaluate each installed skill against the current task.\nFor each skill, determine YES/NO relevance and invoke all YES skills before proceeding.",
|
|
410
|
-
docs: "https://docs.github.com/en/copilot/concepts/agents/about-agent-skills",
|
|
411
|
-
notes: [
|
|
412
|
-
"Copilot auto-detects .claude/skills/ as a legacy path — emitting there covers multiple agents.",
|
|
413
|
-
"Instructions system (.github/instructions/*.instructions.md) is separate, uses applyTo globs.",
|
|
414
|
-
"copilot-instructions.md at .github/ root is always applied (repo-wide).",
|
|
415
|
-
"AGENTS.md also recognized as of Aug 2025.",
|
|
416
|
-
"excludeAgent property in instructions can hide from code-review or coding-agent.",
|
|
417
|
-
"Keep SKILL.md under 500 lines / 5000 tokens for optimal loading."
|
|
418
|
-
]
|
|
419
|
-
});
|
|
420
|
-
const configHome$1 = () => process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
421
|
-
const goose = defineTarget({
|
|
422
|
-
agent: "goose",
|
|
423
|
-
displayName: "Goose",
|
|
424
|
-
detectInstalled: () => existsSync(join(configHome$1(), "goose")),
|
|
425
|
-
detectEnv: () => !!(process.env.GOOSE_SESSION || process.env.AGENT_SESSION_ID),
|
|
426
|
-
detectProject: (cwd) => existsSync(join(cwd, ".goose")),
|
|
427
|
-
cli: "goose",
|
|
428
|
-
instructionFile: ".goosehints",
|
|
429
|
-
skillsDir: ".goose/skills",
|
|
430
|
-
globalSkillsDir: () => join(configHome$1(), "goose/skills"),
|
|
431
|
-
additionalSkillsDirs: [
|
|
432
|
-
".claude/skills",
|
|
433
|
-
".agents/skills",
|
|
434
|
-
"~/.claude/skills",
|
|
435
|
-
"~/.config/agents/skills"
|
|
436
|
-
],
|
|
437
|
-
frontmatter: [{
|
|
438
|
-
...SPEC_FRONTMATTER.name,
|
|
439
|
-
description: "Skill identifier."
|
|
440
|
-
}, {
|
|
441
|
-
...SPEC_FRONTMATTER.description,
|
|
442
|
-
description: "Brief purpose statement; used for matching."
|
|
443
|
-
}],
|
|
444
|
-
discoveryStrategy: "eager",
|
|
445
|
-
discoveryNotes: "Scans all 6 directories at startup, merges discovered skills. Later directories override earlier ones on name conflict.",
|
|
446
|
-
agentSkillsSpec: false,
|
|
447
|
-
docs: "https://block.github.io/goose/docs/guides/context-engineering/using-skills/",
|
|
448
|
-
notes: [
|
|
449
|
-
"Reads .claude/skills/ natively — emitting there covers both Claude Code and Goose.",
|
|
450
|
-
"Also supports .goosehints / .goosehints.local for general project instructions (separate from skills).",
|
|
451
|
-
"Supporting files alongside SKILL.md (scripts, templates, configs) are accessible."
|
|
452
|
-
]
|
|
453
|
-
});
|
|
454
|
-
const configHome = () => process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
455
|
-
const opencode = defineTarget({
|
|
456
|
-
agent: "opencode",
|
|
457
|
-
displayName: "OpenCode",
|
|
458
|
-
detectInstalled: () => existsSync(join(configHome(), "opencode")),
|
|
459
|
-
detectEnv: () => !!(process.env.OPENCODE_SESSION || process.env.OPENCODE_SESSION_ID),
|
|
460
|
-
detectProject: (cwd) => existsSync(join(cwd, ".opencode")),
|
|
461
|
-
instructionFile: "AGENTS.md",
|
|
462
|
-
skillsDir: ".opencode/skills",
|
|
463
|
-
globalSkillsDir: () => join(configHome(), "opencode/skills"),
|
|
464
|
-
additionalSkillsDirs: [
|
|
465
|
-
".claude/skills",
|
|
466
|
-
".agents/skills",
|
|
467
|
-
"~/.claude/skills",
|
|
468
|
-
"~/.agents/skills"
|
|
469
|
-
],
|
|
470
|
-
frontmatter: [
|
|
471
|
-
{
|
|
472
|
-
...SPEC_FRONTMATTER.name,
|
|
473
|
-
description: "Must match directory name."
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
...SPEC_FRONTMATTER.description,
|
|
477
|
-
description: "Used for matching."
|
|
478
|
-
},
|
|
479
|
-
SPEC_FRONTMATTER.license,
|
|
480
|
-
SPEC_FRONTMATTER.compatibility,
|
|
481
|
-
SPEC_FRONTMATTER.metadata
|
|
482
|
-
],
|
|
483
|
-
discoveryStrategy: "eager",
|
|
484
|
-
discoveryNotes: "Walks from CWD to git worktree root, then loads global definitions. Agents access skills via native skill tool. Skills can be permission-controlled per-agent.",
|
|
485
|
-
agentSkillsSpec: true,
|
|
486
|
-
extensions: ["Per-agent skill permissions (allow/deny/ask with glob patterns)"],
|
|
487
|
-
docs: "https://opencode.ai/docs/skills/",
|
|
488
|
-
notes: [
|
|
489
|
-
"Reads .claude/skills/ and .agents/skills/ natively — emitting to .claude/skills/ covers multiple agents.",
|
|
490
|
-
"Custom agents in .opencode/agents/ have rich config: model, temperature, tools, permission, color.",
|
|
491
|
-
"opencode.json supports an instructions field with glob patterns pointing to instruction files.",
|
|
492
|
-
"AGENTS.md (or CLAUDE.md fallback) for general instructions."
|
|
493
|
-
]
|
|
494
|
-
});
|
|
495
|
-
const home$1 = () => homedir();
|
|
496
|
-
const roo = defineTarget({
|
|
497
|
-
agent: "roo",
|
|
498
|
-
displayName: "Roo Code",
|
|
499
|
-
detectInstalled: () => existsSync(join(home$1(), ".roo")),
|
|
500
|
-
detectEnv: () => !!process.env.ROO_SESSION,
|
|
501
|
-
detectProject: (cwd) => existsSync(join(cwd, ".roo")),
|
|
502
|
-
instructionFile: ".roorules",
|
|
503
|
-
skillsDir: ".roo/skills",
|
|
504
|
-
globalSkillsDir: () => join(home$1(), ".roo/skills"),
|
|
505
|
-
frontmatter: [{
|
|
506
|
-
...SPEC_FRONTMATTER.name,
|
|
507
|
-
description: "Must exactly match the directory name."
|
|
508
|
-
}, {
|
|
509
|
-
...SPEC_FRONTMATTER.description,
|
|
510
|
-
description: "When to activate."
|
|
511
|
-
}],
|
|
512
|
-
discoveryStrategy: "eager",
|
|
513
|
-
discoveryNotes: "Reads all SKILL.md files at startup. File watchers detect changes during session. Uses read_file to load full content on activation.",
|
|
514
|
-
agentSkillsSpec: false,
|
|
515
|
-
extensions: ["Mode-specific skill directories: .roo/skills-{modeSlug}/"],
|
|
516
|
-
docs: "https://docs.roocode.com/features/skills",
|
|
517
|
-
notes: [
|
|
518
|
-
"Does NOT read .claude/skills/ or .agents/skills/ — requires its own .roo/skills/ directory.",
|
|
519
|
-
"Mode-specific dirs: .roo/skills-code/, .roo/skills-architect/ etc. target specific modes.",
|
|
520
|
-
"Override priority: project mode-specific > project generic > global mode-specific > global generic.",
|
|
521
|
-
"Supports symlinks for shared skill libraries across projects.",
|
|
522
|
-
"Rules system (.roo/rules/) is separate — .md/.txt files loaded alphabetically into system prompt.",
|
|
523
|
-
"Legacy fallback: .roorules file if .roo/rules/ is empty.",
|
|
524
|
-
"Skills manageable from Settings panel (v3.46.0+)."
|
|
525
|
-
]
|
|
526
|
-
});
|
|
527
|
-
const home = () => homedir();
|
|
528
|
-
const targets = {
|
|
529
|
-
"claude-code": claudeCode,
|
|
530
|
-
"cursor": cursor,
|
|
531
|
-
"windsurf": defineTarget({
|
|
532
|
-
agent: "windsurf",
|
|
533
|
-
displayName: "Windsurf",
|
|
534
|
-
detectInstalled: () => existsSync(join(home(), ".codeium/windsurf")),
|
|
535
|
-
detectEnv: () => !!process.env.WINDSURF_SESSION,
|
|
536
|
-
detectProject: (cwd) => existsSync(join(cwd, ".windsurf")) || existsSync(join(cwd, ".windsurfrules")),
|
|
537
|
-
instructionFile: ".windsurfrules",
|
|
538
|
-
skillsDir: ".windsurf/skills",
|
|
539
|
-
globalSkillsDir: () => join(home(), ".codeium/windsurf/skills"),
|
|
540
|
-
frontmatter: [{
|
|
541
|
-
...SPEC_FRONTMATTER.name,
|
|
542
|
-
description: "Skill identifier.",
|
|
543
|
-
constraints: "Lowercase, numbers, hyphens only"
|
|
544
|
-
}, {
|
|
545
|
-
...SPEC_FRONTMATTER.description,
|
|
546
|
-
description: "Used by Cascade for automatic invocation matching."
|
|
547
|
-
}],
|
|
548
|
-
discoveryStrategy: "eager",
|
|
549
|
-
discoveryNotes: "Cascade matches description against user requests for auto-invocation. Manual invocation via @skill-name.",
|
|
550
|
-
agentSkillsSpec: false,
|
|
551
|
-
docs: "https://docs.windsurf.com/windsurf/cascade/skills",
|
|
552
|
-
notes: [
|
|
553
|
-
"Only `name` and `description` are documented as frontmatter fields. Other fields may be silently ignored.",
|
|
554
|
-
"Rules system is separate: .windsurf/rules/*.md with trigger/globs/alwaysApply frontmatter.",
|
|
555
|
-
"Rules have a 6,000 char per-file limit and 12,000 char total limit. Skills have no documented limit.",
|
|
556
|
-
"Legacy .windsurfrules at project root still supported but deprecated.",
|
|
557
|
-
"Supporting files alongside SKILL.md are loaded via progressive disclosure."
|
|
558
|
-
]
|
|
559
|
-
}),
|
|
560
|
-
"cline": cline,
|
|
561
|
-
"codex": codex,
|
|
562
|
-
"github-copilot": githubCopilot,
|
|
563
|
-
"gemini-cli": geminiCli,
|
|
564
|
-
"goose": goose,
|
|
565
|
-
"amp": amp,
|
|
566
|
-
"opencode": opencode,
|
|
567
|
-
"roo": roo,
|
|
568
|
-
"antigravity": antigravity
|
|
569
|
-
};
|
|
570
|
-
const STATIC_REGEX_1 = /v?(\d+\.\d+\.\d+(?:-[a-z0-9.]+)?)/;
|
|
571
|
-
function detectInstalledAgents() {
|
|
572
|
-
return Object.entries(targets).filter(([_, config]) => config.detectInstalled()).map(([type]) => type);
|
|
573
|
-
}
|
|
574
|
-
function detectTargetAgent() {
|
|
575
|
-
for (const [type, target] of Object.entries(targets)) if (target.detectEnv()) return type;
|
|
576
|
-
const cwd = process.cwd();
|
|
577
|
-
const projectMatches = [];
|
|
578
|
-
for (const [type, target] of Object.entries(targets)) if (target.detectProject(cwd)) projectMatches.push(type);
|
|
579
|
-
return projectMatches.length === 1 ? projectMatches[0] : null;
|
|
580
|
-
}
|
|
581
|
-
function detectProjectAgents() {
|
|
582
|
-
const cwd = process.cwd();
|
|
583
|
-
return Object.entries(targets).filter(([, target]) => target.detectProject(cwd)).map(([type]) => type);
|
|
584
|
-
}
|
|
585
|
-
function getAgentVersion(agentType) {
|
|
586
|
-
const agent = targets[agentType];
|
|
587
|
-
if (!agent.cli) return null;
|
|
588
|
-
try {
|
|
589
|
-
const result = spawnSync(agent.cli, ["--version"], {
|
|
590
|
-
encoding: "utf-8",
|
|
591
|
-
timeout: 3e3,
|
|
592
|
-
stdio: [
|
|
593
|
-
"pipe",
|
|
594
|
-
"pipe",
|
|
595
|
-
"pipe"
|
|
596
|
-
],
|
|
597
|
-
shell: isWindows
|
|
598
|
-
});
|
|
599
|
-
if (result.status !== 0) return null;
|
|
600
|
-
const output = (result.stdout || "").trim();
|
|
601
|
-
const match = output.match(STATIC_REGEX_1);
|
|
602
|
-
return match ? match[1] : output.split("\n")[0];
|
|
603
|
-
} catch {
|
|
604
|
-
return null;
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
export { detectInstalledAgents, detectProjectAgents, detectTargetAgent, getAgentVersion, targets };
|
|
608
|
-
|
|
609
|
-
//# sourceMappingURL=detect.mjs.map
|