@rbbtsn0w/adg 0.6.0-beta.9 → 0.7.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.
Files changed (50) hide show
  1. package/README.md +10 -7
  2. package/dist/bin/adg.js +4 -3
  3. package/dist/src/agents/base.js +2 -1
  4. package/dist/src/cli/core-plugin-handlers.js +97 -0
  5. package/dist/src/cli/handlers.js +4 -82
  6. package/dist/src/manifest.js +56 -3
  7. package/dist/src/subprocess.js +53 -0
  8. package/dist/vendor/skills/src/add.js +0 -15
  9. package/dist/vendor/skills/src/git-tree.js +4 -4
  10. package/dist/vendor/skills/src/skill-lock.js +4 -3
  11. package/dist/vendor/skills/src/update.js +9 -73
  12. package/dist/vendor/skills/src/use.js +28 -4
  13. package/docs/branching-and-release.md +52 -0
  14. package/package.json +11 -2
  15. package/schemas/adg-plugin.schema.json +1 -0
  16. package/vendor/skills/PROVENANCE.md +2 -0
  17. package/vendor/skills/package.json +0 -144
  18. package/vendor/skills/src/add.ts +0 -2213
  19. package/vendor/skills/src/agents.ts +0 -811
  20. package/vendor/skills/src/blob.ts +0 -588
  21. package/vendor/skills/src/cli.ts +0 -396
  22. package/vendor/skills/src/constants.ts +0 -3
  23. package/vendor/skills/src/detect-agent.ts +0 -62
  24. package/vendor/skills/src/find.ts +0 -419
  25. package/vendor/skills/src/frontmatter.ts +0 -16
  26. package/vendor/skills/src/git-tree.ts +0 -36
  27. package/vendor/skills/src/git.ts +0 -277
  28. package/vendor/skills/src/install.ts +0 -91
  29. package/vendor/skills/src/installer.ts +0 -1307
  30. package/vendor/skills/src/list.ts +0 -231
  31. package/vendor/skills/src/local-lock.ts +0 -189
  32. package/vendor/skills/src/plugin-manifest.ts +0 -183
  33. package/vendor/skills/src/prompts/search-multiselect.ts +0 -387
  34. package/vendor/skills/src/providers/index.ts +0 -14
  35. package/vendor/skills/src/providers/registry.ts +0 -51
  36. package/vendor/skills/src/providers/types.ts +0 -97
  37. package/vendor/skills/src/providers/wellknown.ts +0 -812
  38. package/vendor/skills/src/remove.ts +0 -335
  39. package/vendor/skills/src/sanitize.ts +0 -65
  40. package/vendor/skills/src/self-cli.ts +0 -20
  41. package/vendor/skills/src/skill-lock.ts +0 -329
  42. package/vendor/skills/src/skills.ts +0 -316
  43. package/vendor/skills/src/source-parser.ts +0 -449
  44. package/vendor/skills/src/sync.ts +0 -478
  45. package/vendor/skills/src/telemetry.ts +0 -226
  46. package/vendor/skills/src/test-utils.ts +0 -73
  47. package/vendor/skills/src/types.ts +0 -129
  48. package/vendor/skills/src/update-source.ts +0 -90
  49. package/vendor/skills/src/update.ts +0 -849
  50. package/vendor/skills/src/use.ts +0 -682
@@ -1,396 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { writeFileSync, readFileSync, existsSync, mkdirSync } from 'fs';
4
- import { basename, join, dirname } from 'path';
5
- import { fileURLToPath } from 'url';
6
- import { runAdd, parseAddOptions } from './add.ts';
7
- import { runFind } from './find.ts';
8
- import { runInstallFromLock } from './install.ts';
9
- import { runList } from './list.ts';
10
- import { removeCommand, parseRemoveOptions } from './remove.ts';
11
- import { runSync, parseSyncOptions } from './sync.ts';
12
- import { flushTelemetry } from './telemetry.ts';
13
- import { isRunningInAgent } from './detect-agent.ts';
14
- import { runUpdate } from './update.ts';
15
- import { runUse, parseUseOptions } from './use.ts';
16
-
17
- const __dirname = dirname(fileURLToPath(import.meta.url));
18
-
19
- function getVersion(): string {
20
- try {
21
- const pkgPath = join(__dirname, '..', 'package.json');
22
- const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
23
- return pkg.version;
24
- } catch {
25
- return '0.0.0';
26
- }
27
- }
28
-
29
- const VERSION = getVersion();
30
-
31
- const RESET = '\x1b[0m';
32
- const BOLD = '\x1b[1m';
33
- // 256-color grays - visible on both light and dark backgrounds
34
- const DIM = '\x1b[38;5;102m'; // darker gray for secondary text
35
- const TEXT = '\x1b[38;5;145m'; // lighter gray for primary text
36
-
37
- const LOGO_LINES = [
38
- '███████╗██╗ ██╗██╗██╗ ██╗ ███████╗',
39
- '██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝',
40
- '███████╗█████╔╝ ██║██║ ██║ ███████╗',
41
- '╚════██║██╔═██╗ ██║██║ ██║ ╚════██║',
42
- '███████║██║ ██╗██║███████╗███████╗███████║',
43
- '╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝╚══════╝',
44
- ];
45
-
46
- // 256-color middle grays - visible on both light and dark backgrounds
47
- const GRAYS = [
48
- '\x1b[38;5;250m', // lighter gray
49
- '\x1b[38;5;248m',
50
- '\x1b[38;5;245m', // mid gray
51
- '\x1b[38;5;243m',
52
- '\x1b[38;5;240m',
53
- '\x1b[38;5;238m', // darker gray
54
- ];
55
-
56
- function showLogo(): void {
57
- console.log();
58
- LOGO_LINES.forEach((line, i) => {
59
- console.log(`${GRAYS[i]}${line}${RESET}`);
60
- });
61
- }
62
-
63
- function showBanner(): void {
64
- showLogo();
65
- console.log();
66
- console.log(`${DIM}The open agent skills ecosystem${RESET}`);
67
- console.log();
68
- console.log(
69
- ` ${DIM}$${RESET} ${TEXT}npx skills add ${DIM}<package>${RESET} ${DIM}Add a new skill${RESET}`
70
- );
71
- console.log(
72
- ` ${DIM}$${RESET} ${TEXT}npx skills use ${DIM}<package>@<skill>${RESET} ${DIM}Use a skill without installing${RESET}`
73
- );
74
- console.log(
75
- ` ${DIM}$${RESET} ${TEXT}npx skills remove${RESET} ${DIM}Remove installed skills${RESET}`
76
- );
77
- console.log(
78
- ` ${DIM}$${RESET} ${TEXT}npx skills list${RESET} ${DIM}List installed skills${RESET}`
79
- );
80
- console.log(
81
- ` ${DIM}$${RESET} ${TEXT}npx skills find ${DIM}[query]${RESET} ${DIM}Search for skills${RESET}`
82
- );
83
- console.log();
84
- console.log(
85
- ` ${DIM}$${RESET} ${TEXT}npx skills update${RESET} ${DIM}Update installed skills${RESET}`
86
- );
87
- console.log();
88
- console.log(
89
- ` ${DIM}$${RESET} ${TEXT}npx skills experimental_install${RESET} ${DIM}Restore from skills-lock.json${RESET}`
90
- );
91
- console.log(
92
- ` ${DIM}$${RESET} ${TEXT}npx skills init ${DIM}[name]${RESET} ${DIM}Create a new skill${RESET}`
93
- );
94
- console.log(
95
- ` ${DIM}$${RESET} ${TEXT}npx skills experimental_sync${RESET} ${DIM}Sync skills from node_modules${RESET}`
96
- );
97
- console.log();
98
- console.log(`${DIM}try:${RESET} npx skills add vercel-labs/agent-skills`);
99
- console.log();
100
- console.log(`Discover more skills at ${TEXT}https://skills.sh/${RESET}`);
101
- console.log();
102
- }
103
-
104
- function showHelp(): void {
105
- console.log(`
106
- ${BOLD}Usage:${RESET} skills <command> [options]
107
-
108
- ${BOLD}Manage Skills:${RESET}
109
- add <package> Add a skill package (alias: a)
110
- e.g. vercel-labs/agent-skills
111
- https://github.com/vercel-labs/agent-skills
112
- use <package>@<skill>
113
- Generate a prompt for using one skill without installing it
114
- remove [skills] Remove installed skills
115
- list, ls List installed skills
116
- find [query] Search for skills interactively
117
-
118
- ${BOLD}Find Options:${RESET}
119
- --owner <owner> Search only repositories from a GitHub owner
120
-
121
- ${BOLD}Updates:${RESET}
122
- update [skills...] Update skills to latest versions (alias: upgrade)
123
-
124
- ${BOLD}Update Options:${RESET}
125
- -g, --global Update global skills only
126
- -p, --project Update project skills only
127
- -y, --yes Skip scope prompt (auto-detect: project if in a project, else global)
128
-
129
- ${BOLD}Project:${RESET}
130
- experimental_install Restore skills from skills-lock.json
131
- init [name] Initialize a skill (creates <name>/SKILL.md or ./SKILL.md)
132
- experimental_sync Sync skills from node_modules into agent directories
133
-
134
- ${BOLD}Add Options:${RESET}
135
- -g, --global Install skill globally (user-level) instead of project-level
136
- -a, --agent <agents> Specify agents to install to (use '*' for all agents)
137
- -s, --skill <skills> Specify skill names to install (use '*' for all skills)
138
- -l, --list List available skills in the repository without installing
139
- -y, --yes Skip confirmation prompts
140
- --copy Copy files instead of symlinking to agent directories
141
- --subagent <names> Install to Eve subagents (use 'root' for the root agent)
142
- --all Shorthand for --skill '*' --agent '*' -y
143
- --full-depth Search all subdirectories even when a root SKILL.md exists
144
-
145
- ${BOLD}Use Options:${RESET}
146
- -s, --skill <skill> Specify the skill to use
147
- -a, --agent <agent> Start one supported agent interactively
148
- --full-depth Search all subdirectories even when a root SKILL.md exists
149
- --dangerously-accept-openclaw-risks
150
- Allow unverified OpenClaw community skills
151
-
152
- ${BOLD}Remove Options:${RESET}
153
- -g, --global Remove from global scope
154
- -a, --agent <agents> Remove from specific agents (use '*' for all agents)
155
- -s, --skill <skills> Specify skills to remove (use '*' for all skills)
156
- -y, --yes Skip confirmation prompts
157
- --all Shorthand for --skill '*' --agent '*' -y
158
-
159
- ${BOLD}Experimental Sync Options:${RESET}
160
- -a, --agent <agents> Specify agents to install to (use '*' for all agents)
161
- -y, --yes Skip confirmation prompts
162
-
163
- ${BOLD}List Options:${RESET}
164
- -g, --global List global skills (default: project)
165
- -a, --agent <agents> Filter by specific agents
166
- --json Output as JSON (machine-readable, no ANSI codes)
167
-
168
- ${BOLD}Options:${RESET}
169
- --help, -h Show this help message
170
- --version, -v Show version number
171
-
172
- ${BOLD}Examples:${RESET}
173
- ${DIM}$${RESET} skills add vercel-labs/agent-skills
174
- ${DIM}$${RESET} skills use vercel-labs/agent-skills@vercel-optimize | claude
175
- ${DIM}$${RESET} skills use vercel-labs/agent-skills --skill vercel-optimize --agent claude-code
176
- ${DIM}$${RESET} skills add vercel-labs/agent-skills -g
177
- ${DIM}$${RESET} skills add vercel-labs/agent-skills --agent claude-code cursor
178
- ${DIM}$${RESET} skills add vercel-labs/agent-skills --skill pr-review commit
179
- ${DIM}$${RESET} skills remove ${DIM}# interactive remove${RESET}
180
- ${DIM}$${RESET} skills remove web-design ${DIM}# remove by name${RESET}
181
- ${DIM}$${RESET} skills rm --global frontend-design
182
- ${DIM}$${RESET} skills list ${DIM}# list project skills${RESET}
183
- ${DIM}$${RESET} skills ls -g ${DIM}# list global skills${RESET}
184
- ${DIM}$${RESET} skills ls -a claude-code ${DIM}# filter by agent${RESET}
185
- ${DIM}$${RESET} skills ls --json ${DIM}# JSON output${RESET}
186
- ${DIM}$${RESET} skills find ${DIM}# interactive search${RESET}
187
- ${DIM}$${RESET} skills find typescript ${DIM}# search by keyword${RESET}
188
- ${DIM}$${RESET} skills find react --owner vercel ${DIM}# search within an owner${RESET}
189
- ${DIM}$${RESET} skills update
190
- ${DIM}$${RESET} skills update my-skill ${DIM}# update a single skill${RESET}
191
- ${DIM}$${RESET} skills update -g ${DIM}# update global skills only${RESET}
192
- ${DIM}$${RESET} skills experimental_install ${DIM}# restore from skills-lock.json${RESET}
193
- ${DIM}$${RESET} skills init my-skill
194
- ${DIM}$${RESET} skills experimental_sync ${DIM}# sync from node_modules${RESET}
195
- ${DIM}$${RESET} skills experimental_sync -y ${DIM}# sync without prompts${RESET}
196
-
197
- Discover more skills at ${TEXT}https://skills.sh/${RESET}
198
- `);
199
- }
200
-
201
- function showRemoveHelp(): void {
202
- console.log(`
203
- ${BOLD}Usage:${RESET} skills remove [skills...] [options]
204
-
205
- ${BOLD}Description:${RESET}
206
- Remove installed skills from agents. If no skill names are provided,
207
- an interactive selection menu will be shown.
208
-
209
- ${BOLD}Arguments:${RESET}
210
- skills Optional skill names to remove (space-separated)
211
-
212
- ${BOLD}Options:${RESET}
213
- -g, --global Remove from global scope (~/) instead of project scope
214
- -a, --agent Remove from specific agents (use '*' for all agents)
215
- -s, --skill Specify skills to remove (use '*' for all skills)
216
- -y, --yes Skip confirmation prompts
217
- --all Shorthand for --skill '*' --agent '*' -y
218
-
219
- ${BOLD}Examples:${RESET}
220
- ${DIM}$${RESET} skills remove ${DIM}# interactive selection${RESET}
221
- ${DIM}$${RESET} skills remove my-skill ${DIM}# remove specific skill${RESET}
222
- ${DIM}$${RESET} skills remove skill1 skill2 -y ${DIM}# remove multiple skills${RESET}
223
- ${DIM}$${RESET} skills remove --global my-skill ${DIM}# remove from global scope${RESET}
224
- ${DIM}$${RESET} skills rm --agent claude-code my-skill ${DIM}# remove from specific agent${RESET}
225
- ${DIM}$${RESET} skills remove --all ${DIM}# remove all skills${RESET}
226
- ${DIM}$${RESET} skills remove --skill '*' -a cursor ${DIM}# remove all skills from cursor${RESET}
227
-
228
- Discover more skills at ${TEXT}https://skills.sh/${RESET}
229
- `);
230
- }
231
-
232
- function runInit(args: string[]): void {
233
- const cwd = process.cwd();
234
- const skillName = args[0] || basename(cwd);
235
- const hasName = args[0] !== undefined;
236
-
237
- const skillDir = hasName ? join(cwd, skillName) : cwd;
238
- const skillFile = join(skillDir, 'SKILL.md');
239
- const displayPath = hasName ? `${skillName}/SKILL.md` : 'SKILL.md';
240
-
241
- if (existsSync(skillFile)) {
242
- console.log(`${TEXT}Skill already exists at ${DIM}${displayPath}${RESET}`);
243
- return;
244
- }
245
-
246
- if (hasName) {
247
- mkdirSync(skillDir, { recursive: true });
248
- }
249
-
250
- const skillContent = `---
251
- name: ${skillName}
252
- description: A brief description of what this skill does
253
- ---
254
-
255
- # ${skillName}
256
-
257
- Instructions for the agent to follow when this skill is activated.
258
-
259
- ## When to use
260
-
261
- Describe when this skill should be used.
262
-
263
- ## Instructions
264
-
265
- 1. First step
266
- 2. Second step
267
- 3. Additional steps as needed
268
- `;
269
-
270
- writeFileSync(skillFile, skillContent);
271
-
272
- console.log(`${TEXT}Initialized skill: ${DIM}${skillName}${RESET}`);
273
- console.log();
274
- console.log(`${DIM}Created:${RESET}`);
275
- console.log(` ${displayPath}`);
276
- console.log();
277
- console.log(`${DIM}Next steps:${RESET}`);
278
- console.log(` 1. Edit ${TEXT}${displayPath}${RESET} to define your skill instructions`);
279
- console.log(
280
- ` 2. Update the ${TEXT}name${RESET} and ${TEXT}description${RESET} in the frontmatter`
281
- );
282
- console.log();
283
- console.log(`${DIM}Publishing:${RESET}`);
284
- console.log(
285
- ` ${DIM}GitHub:${RESET} Push to a repo, then ${TEXT}npx skills add <owner>/<repo>${RESET}`
286
- );
287
- console.log(
288
- ` ${DIM}URL:${RESET} Host the file, then ${TEXT}npx skills add https://example.com/${displayPath}${RESET}`
289
- );
290
- console.log();
291
- console.log(`Browse existing skills for inspiration at ${TEXT}https://skills.sh/${RESET}`);
292
- console.log();
293
- }
294
-
295
- // ============================================
296
- // Main
297
- // ============================================
298
-
299
- async function main(): Promise<void> {
300
- const args = process.argv.slice(2);
301
- const inAgent = await isRunningInAgent();
302
-
303
- if (args.length === 0) {
304
- if (!inAgent) {
305
- showBanner();
306
- }
307
- return;
308
- }
309
-
310
- const command = args[0];
311
- const restArgs = args.slice(1);
312
-
313
- switch (command) {
314
- case 'find':
315
- case 'search':
316
- case 'f':
317
- case 's':
318
- if (!inAgent) showLogo();
319
- console.log();
320
- await runFind(restArgs);
321
- break;
322
- case 'init':
323
- if (!inAgent) showLogo();
324
- console.log();
325
- runInit(restArgs);
326
- break;
327
- case 'experimental_install': {
328
- if (!inAgent) showLogo();
329
- await runInstallFromLock(restArgs);
330
- break;
331
- }
332
- case 'i':
333
- case 'install':
334
- case 'a':
335
- case 'add': {
336
- if (!inAgent) showLogo();
337
- const { source: addSource, options: addOpts } = parseAddOptions(restArgs);
338
- await runAdd(addSource, addOpts);
339
- break;
340
- }
341
- case 'use': {
342
- const {
343
- source: useSource,
344
- options: useOptions,
345
- errors: useErrors,
346
- } = parseUseOptions(restArgs);
347
- await runUse(useSource, useOptions, useErrors);
348
- break;
349
- }
350
- case 'remove':
351
- case 'rm':
352
- case 'r':
353
- // Check for --help or -h flag
354
- if (restArgs.includes('--help') || restArgs.includes('-h')) {
355
- showRemoveHelp();
356
- break;
357
- }
358
- const { skills, options: removeOptions } = parseRemoveOptions(restArgs);
359
- await removeCommand(skills, removeOptions);
360
- break;
361
- case 'experimental_sync': {
362
- if (!inAgent) showLogo();
363
- const { options: syncOptions } = parseSyncOptions(restArgs);
364
- await runSync(restArgs, syncOptions);
365
- break;
366
- }
367
- case 'list':
368
- case 'ls':
369
- await runList(restArgs);
370
- break;
371
- case 'check':
372
- case 'update':
373
- case 'upgrade':
374
- await runUpdate(restArgs);
375
- break;
376
- case '--help':
377
- case '-h':
378
- showHelp();
379
- break;
380
- case '--version':
381
- case '-v':
382
- console.log(VERSION);
383
- break;
384
-
385
- default:
386
- console.log(`Unknown command: ${command}`);
387
- console.log(`Run ${BOLD}skills --help${RESET} for usage.`);
388
- }
389
- }
390
-
391
- main()
392
- .catch((error) => {
393
- console.error(error instanceof Error ? error.message : String(error));
394
- process.exitCode = 1;
395
- })
396
- .finally(() => flushTelemetry().then(() => process.exit(process.exitCode ?? 0)));
@@ -1,3 +0,0 @@
1
- export const AGENTS_DIR = '.agents';
2
- export const SKILLS_SUBDIR = 'skills';
3
- export const UNIVERSAL_SKILLS_DIR = '.agents/skills';
@@ -1,62 +0,0 @@
1
- import { determineAgent, type AgentResult } from '@vercel/detect-agent';
2
- import { setDetectedAgent } from './telemetry.ts';
3
- import type { AgentType } from './types.ts';
4
-
5
- let cachedResult: AgentResult | null = null;
6
-
7
- /**
8
- * Map from @vercel/detect-agent names to skills-cli AgentType identifiers.
9
- * Only includes agents that exist in both systems.
10
- */
11
- const agentNameToType: Record<string, AgentType> = {
12
- cursor: 'cursor',
13
- 'cursor-cli': 'cursor',
14
- claude: 'claude-code',
15
- cowork: 'claude-code',
16
- devin: 'universal', // Devin not in skills-cli agent list, use universal
17
- replit: 'replit',
18
- gemini: 'gemini-cli',
19
- codex: 'codex',
20
- antigravity: 'antigravity',
21
- 'augment-cli': 'augment',
22
- opencode: 'opencode',
23
- 'github-copilot': 'github-copilot',
24
- };
25
-
26
- /**
27
- * Detect if the CLI is being run inside an AI agent environment.
28
- * Results are cached after the first call. Also updates telemetry with the agent name.
29
- */
30
- export async function detectAgent(): Promise<AgentResult> {
31
- if (cachedResult) return cachedResult;
32
- cachedResult = await determineAgent();
33
- if (cachedResult.isAgent) {
34
- setDetectedAgent(cachedResult.agent.name);
35
- }
36
- return cachedResult;
37
- }
38
-
39
- /**
40
- * Returns true if the CLI is running inside a detected AI agent.
41
- * When true, the CLI should skip interactive prompts and use sensible defaults.
42
- */
43
- export async function isRunningInAgent(): Promise<boolean> {
44
- const result = await detectAgent();
45
- return result.isAgent;
46
- }
47
-
48
- /**
49
- * Returns the name of the detected agent, or null if not running in an agent.
50
- */
51
- export async function getAgentName(): Promise<string | null> {
52
- const result = await detectAgent();
53
- return result.isAgent ? result.agent.name : null;
54
- }
55
-
56
- /**
57
- * Maps a detected agent name to the corresponding skills-cli AgentType.
58
- * Returns null if the agent can't be mapped to a specific skills-cli agent.
59
- */
60
- export function getAgentType(agentName: string): AgentType | null {
61
- return agentNameToType[agentName] ?? null;
62
- }