@rbbtsn0w/adg 0.1.0-alpha.1 → 0.1.0-beta.2
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/bin/adg.js +703 -0
- package/dist/src/adapters/anthropic.js +54 -0
- package/dist/src/adapters/index.js +10 -0
- package/dist/src/adapters/openai.js +30 -0
- package/dist/src/adapters/reverse.js +53 -0
- package/dist/src/agents/claude.js +118 -0
- package/dist/src/agents/codex.js +61 -0
- package/{src/agents/index.ts → dist/src/agents/index.js} +6 -8
- package/dist/src/agents/registry.js +24 -0
- package/dist/src/agents/types.js +1 -0
- package/dist/src/commands/adapt.js +26 -0
- package/dist/src/commands/import.js +51 -0
- package/dist/src/commands/init.js +104 -0
- package/dist/src/commands/install.js +257 -0
- package/dist/src/commands/link.js +34 -0
- package/dist/src/commands/list.js +19 -0
- package/dist/src/commands/marketplace.js +124 -0
- package/dist/src/commands/migrate.js +60 -0
- package/dist/src/commands/multiselect-skills.js +103 -0
- package/dist/src/commands/remove.js +102 -0
- package/dist/src/commands/select-agents.js +40 -0
- package/dist/src/commands/select-components.js +61 -0
- package/dist/src/commands/select-plugins.js +25 -0
- package/dist/src/commands/select-scope.js +20 -0
- package/dist/src/commands/update.js +50 -0
- package/dist/src/commands/validate.js +50 -0
- package/dist/src/components.js +90 -0
- package/dist/src/deps.js +46 -0
- package/dist/src/fsutil.js +32 -0
- package/dist/src/hash.js +51 -0
- package/dist/src/lock.js +51 -0
- package/dist/src/manifest.js +110 -0
- package/dist/src/marketplace.js +39 -0
- package/{src/package.ts → dist/src/package.js} +37 -42
- package/{src/paths.ts → dist/src/paths.js} +54 -60
- package/dist/src/semver.js +55 -0
- package/dist/src/skills.js +79 -0
- package/dist/src/sources.js +122 -0
- package/dist/src/types.js +19 -0
- package/dist/vendor/skills/package.json +143 -0
- package/dist/vendor/skills/src/add.js +1663 -0
- package/dist/vendor/skills/src/agents.js +729 -0
- package/dist/vendor/skills/src/blob.js +436 -0
- package/dist/vendor/skills/src/cli.js +340 -0
- package/dist/vendor/skills/src/constants.js +3 -0
- package/dist/vendor/skills/src/detect-agent.js +56 -0
- package/dist/vendor/skills/src/find.js +294 -0
- package/dist/vendor/skills/src/frontmatter.js +13 -0
- package/dist/vendor/skills/src/git-tree.js +32 -0
- package/dist/vendor/skills/src/git.js +235 -0
- package/dist/vendor/skills/src/install.js +75 -0
- package/dist/vendor/skills/src/installer.js +924 -0
- package/dist/vendor/skills/src/list.js +201 -0
- package/dist/vendor/skills/src/local-lock.js +109 -0
- package/dist/vendor/skills/src/plugin-manifest.js +152 -0
- package/dist/vendor/skills/src/prompts/search-multiselect.js +312 -0
- package/dist/vendor/skills/src/providers/index.js +4 -0
- package/dist/vendor/skills/src/providers/registry.js +42 -0
- package/dist/vendor/skills/src/providers/types.js +1 -0
- package/dist/vendor/skills/src/providers/wellknown.js +625 -0
- package/dist/vendor/skills/src/remove.js +263 -0
- package/dist/vendor/skills/src/sanitize.js +57 -0
- package/dist/vendor/skills/src/self-cli.js +15 -0
- package/dist/vendor/skills/src/skill-lock.js +237 -0
- package/dist/vendor/skills/src/skills.js +264 -0
- package/dist/vendor/skills/src/source-parser.js +367 -0
- package/dist/vendor/skills/src/sync.js +404 -0
- package/dist/vendor/skills/src/telemetry.js +101 -0
- package/dist/vendor/skills/src/test-utils.js +59 -0
- package/dist/vendor/skills/src/types.js +1 -0
- package/dist/vendor/skills/src/update-source.js +76 -0
- package/dist/vendor/skills/src/update.js +590 -0
- package/dist/vendor/skills/src/use.js +505 -0
- package/package.json +15 -7
- package/bin/adg.ts +0 -758
- package/src/adapters/anthropic.ts +0 -54
- package/src/adapters/index.ts +0 -24
- package/src/adapters/openai.ts +0 -37
- package/src/adapters/reverse.ts +0 -60
- package/src/agents/claude.ts +0 -124
- package/src/agents/codex.ts +0 -67
- package/src/agents/registry.ts +0 -30
- package/src/agents/types.ts +0 -47
- package/src/commands/adapt.ts +0 -36
- package/src/commands/import.ts +0 -69
- package/src/commands/init.ts +0 -146
- package/src/commands/install.ts +0 -411
- package/src/commands/link.ts +0 -61
- package/src/commands/list.ts +0 -28
- package/src/commands/marketplace.ts +0 -198
- package/src/commands/migrate.ts +0 -84
- package/src/commands/multiselect-skills.ts +0 -137
- package/src/commands/remove.ts +0 -136
- package/src/commands/select-agents.ts +0 -45
- package/src/commands/select-components.ts +0 -66
- package/src/commands/select-plugins.ts +0 -28
- package/src/commands/select-scope.ts +0 -21
- package/src/commands/update.ts +0 -85
- package/src/commands/validate.ts +0 -57
- package/src/components.ts +0 -90
- package/src/deps.ts +0 -64
- package/src/fsutil.ts +0 -38
- package/src/hash.ts +0 -61
- package/src/lock.ts +0 -57
- package/src/manifest.ts +0 -113
- package/src/marketplace.ts +0 -41
- package/src/semver.ts +0 -67
- package/src/skills.ts +0 -88
- package/src/sources.ts +0 -159
- package/src/types.ts +0 -140
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readManifest, findManifestFile } from "./manifest.js";
|
|
5
|
+
const GH_SHORTHAND = /^([\w.-]+)\/([\w.-]+?)(?:@(.+))?$/;
|
|
6
|
+
const GH_URL = /^(?:https?:\/\/github\.com\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:@(.+))?$/;
|
|
7
|
+
/**
|
|
8
|
+
* Parse an install spec into a local directory or a GitHub source.
|
|
9
|
+
*
|
|
10
|
+
* An existing local directory always wins; otherwise the spec is matched
|
|
11
|
+
* against `owner/repo[@ref]` shorthand or a github.com URL.
|
|
12
|
+
*/
|
|
13
|
+
export function parseSource(spec) {
|
|
14
|
+
if (existsSync(spec))
|
|
15
|
+
return { kind: "local", dir: spec };
|
|
16
|
+
const url = spec.match(GH_URL);
|
|
17
|
+
if (url) {
|
|
18
|
+
const [, owner, repo, ref] = url;
|
|
19
|
+
return gh(owner, repo, ref);
|
|
20
|
+
}
|
|
21
|
+
const short = spec.match(GH_SHORTHAND);
|
|
22
|
+
if (short) {
|
|
23
|
+
const [, owner, repo, ref] = short;
|
|
24
|
+
return gh(owner, repo, ref);
|
|
25
|
+
}
|
|
26
|
+
throw new Error(`cannot parse install source: "${spec}" (expected a local path or owner/repo[@ref])`);
|
|
27
|
+
}
|
|
28
|
+
function gh(owner, repo, ref) {
|
|
29
|
+
return {
|
|
30
|
+
kind: "github",
|
|
31
|
+
source: `${owner}/${repo}`,
|
|
32
|
+
owner,
|
|
33
|
+
repo,
|
|
34
|
+
ref,
|
|
35
|
+
sourceUrl: `https://github.com/${owner}/${repo}.git`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Shallow-clone a GitHub source into `dest`, optionally restricting the working
|
|
40
|
+
* tree to `sparse` sub-paths (cone-mode sparse checkout) for large monorepos.
|
|
41
|
+
* The git runner is injectable so the flow can be exercised offline in tests.
|
|
42
|
+
*/
|
|
43
|
+
export function cloneGitHub(src, dest, opts = {}) {
|
|
44
|
+
const runner = opts.runner ?? defaultGitRunner;
|
|
45
|
+
const sparse = opts.sparse?.filter(Boolean) ?? [];
|
|
46
|
+
const clone = ["clone", "--depth", "1"];
|
|
47
|
+
if (src.ref)
|
|
48
|
+
clone.push("--branch", src.ref);
|
|
49
|
+
if (sparse.length > 0)
|
|
50
|
+
clone.push("--filter=blob:none", "--sparse");
|
|
51
|
+
clone.push(src.sourceUrl, dest);
|
|
52
|
+
runner(clone);
|
|
53
|
+
if (sparse.length > 0) {
|
|
54
|
+
runner(["-C", dest, "sparse-checkout", "set", ...sparse]);
|
|
55
|
+
}
|
|
56
|
+
return dest;
|
|
57
|
+
}
|
|
58
|
+
const defaultGitRunner = (args) => {
|
|
59
|
+
execFileSync("git", args, { stdio: "pipe" });
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Recursively find ADG plugins under `root` (directories containing
|
|
63
|
+
* `.agents/.plugin.json`, or the legacy `.adg-plugin/plugin.json`), keyed by
|
|
64
|
+
* manifest name. Used as the resolution universe for dependency ordering.
|
|
65
|
+
*/
|
|
66
|
+
export function scanPlugins(root) {
|
|
67
|
+
const found = new Map();
|
|
68
|
+
walk(root, root, found);
|
|
69
|
+
return found;
|
|
70
|
+
}
|
|
71
|
+
function walk(root, current, out) {
|
|
72
|
+
if (findManifestFile(current)) {
|
|
73
|
+
const manifest = readManifest(current);
|
|
74
|
+
if (!out.has(manifest.name))
|
|
75
|
+
out.set(manifest.name, { dir: current, manifest });
|
|
76
|
+
return; // do not descend into a plugin directory
|
|
77
|
+
}
|
|
78
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
79
|
+
if (!entry.isDirectory())
|
|
80
|
+
continue;
|
|
81
|
+
if (entry.name === ".git" || entry.name === "node_modules")
|
|
82
|
+
continue;
|
|
83
|
+
walk(root, join(current, entry.name), out);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export const CODEX_MANIFEST_PATH = join(".codex-plugin", "plugin.json");
|
|
87
|
+
export const CLAUDE_MANIFEST_PATH = join(".claude-plugin", "plugin.json");
|
|
88
|
+
/**
|
|
89
|
+
* Recursively find plugin directories under `root`, recognizing ADG, Codex and
|
|
90
|
+
* Claude manifests. Used by `import` to discover existing plugins to convert.
|
|
91
|
+
*/
|
|
92
|
+
export function scanNativePlugins(root) {
|
|
93
|
+
const found = [];
|
|
94
|
+
walkNative(root, found);
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
function walkNative(current, out) {
|
|
98
|
+
// Resolution priority: canonical .agents/.plugin.json first, then Claude, then
|
|
99
|
+
// Codex. Only matters when a single dir exposes more than one manifest.
|
|
100
|
+
const adg = findManifestFile(current);
|
|
101
|
+
const claude = join(current, CLAUDE_MANIFEST_PATH);
|
|
102
|
+
const codex = join(current, CODEX_MANIFEST_PATH);
|
|
103
|
+
if (adg) {
|
|
104
|
+
out.push({ dir: current, kind: "adg", manifestFile: adg });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (existsSync(claude)) {
|
|
108
|
+
out.push({ dir: current, kind: "anthropic", manifestFile: claude });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (existsSync(codex)) {
|
|
112
|
+
out.push({ dir: current, kind: "openai", manifestFile: codex });
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
for (const entry of readdirSync(current, { withFileTypes: true })) {
|
|
116
|
+
if (!entry.isDirectory())
|
|
117
|
+
continue;
|
|
118
|
+
if (entry.name === ".git" || entry.name === "node_modules")
|
|
119
|
+
continue;
|
|
120
|
+
walkNative(join(current, entry.name), out);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADG type definitions mirroring the JSON Schemas under ../schemas.
|
|
3
|
+
*/
|
|
4
|
+
export const ADG_SCHEMA_VERSION = "adg.plugin/v1";
|
|
5
|
+
export const LOCK_VERSION = 2;
|
|
6
|
+
/** The component categories a plugin can expose. */
|
|
7
|
+
export const COMPONENT_TYPES = ["skills", "agents", "commands", "mcp", "hooks", "apps"];
|
|
8
|
+
/** Structural equality for provenance/source comparison (collision checks). */
|
|
9
|
+
export function sameSource(a, b) {
|
|
10
|
+
if (a.type !== b.type)
|
|
11
|
+
return false;
|
|
12
|
+
if (a.type === "local" && b.type === "local")
|
|
13
|
+
return a.path === b.path;
|
|
14
|
+
if (a.type === "github" && b.type === "github")
|
|
15
|
+
return a.repo === b.repo && a.path === b.path;
|
|
16
|
+
if (a.type === "git" && b.type === "git")
|
|
17
|
+
return a.url === b.url && a.path === b.path;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "skills",
|
|
3
|
+
"version": "1.5.11",
|
|
4
|
+
"description": "The open agent skills ecosystem",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"skills": "./bin/cli.mjs",
|
|
8
|
+
"add-skill": "./bin/cli.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin",
|
|
13
|
+
"README.md",
|
|
14
|
+
"ThirdPartyNoticeText.txt"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "node scripts/generate-licenses.ts && obuild",
|
|
18
|
+
"generate-licenses": "node scripts/generate-licenses.ts",
|
|
19
|
+
"dev": "node src/cli.ts",
|
|
20
|
+
"exec:test": "node scripts/execute-tests.ts",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"format": "prettier --write \"src/**/*.ts\" \"scripts/**/*.ts\"",
|
|
23
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"scripts/**/*.ts\"",
|
|
24
|
+
"prepare": "husky",
|
|
25
|
+
"test": "vitest",
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"publish:snapshot": "npm version prerelease --preid=snapshot --no-git-tag-version && npm publish --tag snapshot"
|
|
28
|
+
},
|
|
29
|
+
"lint-staged": {
|
|
30
|
+
"src/**/*.ts": "prettier --write",
|
|
31
|
+
"scripts/**/*.ts": "prettier --write",
|
|
32
|
+
"tests/**/*.ts": "prettier --write"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"cli",
|
|
36
|
+
"agent-skills",
|
|
37
|
+
"skills",
|
|
38
|
+
"ai-agents",
|
|
39
|
+
"aider-desk",
|
|
40
|
+
"amp",
|
|
41
|
+
"antigravity",
|
|
42
|
+
"antigravity-cli",
|
|
43
|
+
"astrbot",
|
|
44
|
+
"autohand-code",
|
|
45
|
+
"augment",
|
|
46
|
+
"bob",
|
|
47
|
+
"claude-code",
|
|
48
|
+
"openclaw",
|
|
49
|
+
"cline",
|
|
50
|
+
"codearts-agent",
|
|
51
|
+
"codebuddy",
|
|
52
|
+
"codemaker",
|
|
53
|
+
"codestudio",
|
|
54
|
+
"codex",
|
|
55
|
+
"command-code",
|
|
56
|
+
"continue",
|
|
57
|
+
"cortex",
|
|
58
|
+
"crush",
|
|
59
|
+
"cursor",
|
|
60
|
+
"deepagents",
|
|
61
|
+
"devin",
|
|
62
|
+
"dexto",
|
|
63
|
+
"droid",
|
|
64
|
+
"firebender",
|
|
65
|
+
"forgecode",
|
|
66
|
+
"gemini-cli",
|
|
67
|
+
"github-copilot",
|
|
68
|
+
"goose",
|
|
69
|
+
"hermes-agent",
|
|
70
|
+
"inference-sh",
|
|
71
|
+
"jazz",
|
|
72
|
+
"junie",
|
|
73
|
+
"iflow-cli",
|
|
74
|
+
"kilo",
|
|
75
|
+
"kimi-code-cli",
|
|
76
|
+
"kiro-cli",
|
|
77
|
+
"kode",
|
|
78
|
+
"lingma",
|
|
79
|
+
"loaf",
|
|
80
|
+
"mcpjam",
|
|
81
|
+
"mistral-vibe",
|
|
82
|
+
"moxby",
|
|
83
|
+
"mux",
|
|
84
|
+
"opencode",
|
|
85
|
+
"openhands",
|
|
86
|
+
"ona",
|
|
87
|
+
"pi",
|
|
88
|
+
"qoder",
|
|
89
|
+
"qoder-cn",
|
|
90
|
+
"qwen-code",
|
|
91
|
+
"replit",
|
|
92
|
+
"reasonix",
|
|
93
|
+
"rovodev",
|
|
94
|
+
"roo",
|
|
95
|
+
"tabnine-cli",
|
|
96
|
+
"terramind",
|
|
97
|
+
"tinycloud",
|
|
98
|
+
"trae",
|
|
99
|
+
"trae-cn",
|
|
100
|
+
"warp",
|
|
101
|
+
"windsurf",
|
|
102
|
+
"zed",
|
|
103
|
+
"zencoder",
|
|
104
|
+
"zenflow",
|
|
105
|
+
"neovate",
|
|
106
|
+
"pochi",
|
|
107
|
+
"promptscript",
|
|
108
|
+
"adal",
|
|
109
|
+
"universal"
|
|
110
|
+
],
|
|
111
|
+
"repository": {
|
|
112
|
+
"type": "git",
|
|
113
|
+
"url": "git+https://github.com/vercel-labs/skills.git"
|
|
114
|
+
},
|
|
115
|
+
"homepage": "https://github.com/vercel-labs/skills#readme",
|
|
116
|
+
"bugs": {
|
|
117
|
+
"url": "https://github.com/vercel-labs/skills/issues"
|
|
118
|
+
},
|
|
119
|
+
"author": "",
|
|
120
|
+
"license": "MIT",
|
|
121
|
+
"devDependencies": {
|
|
122
|
+
"@clack/prompts": "^0.11.0",
|
|
123
|
+
"@types/bun": "latest",
|
|
124
|
+
"@types/node": "^22.10.0",
|
|
125
|
+
"@vercel/detect-agent": "^1.2.1",
|
|
126
|
+
"husky": "^9.1.7",
|
|
127
|
+
"lint-staged": "^16.2.7",
|
|
128
|
+
"obuild": "^0.4.22",
|
|
129
|
+
"picocolors": "^1.1.1",
|
|
130
|
+
"prettier": "^3.8.1",
|
|
131
|
+
"simple-git": "^3.27.0",
|
|
132
|
+
"typescript": "^5.9.3",
|
|
133
|
+
"vitest": "^4.0.17",
|
|
134
|
+
"xdg-basedir": "^5.1.0"
|
|
135
|
+
},
|
|
136
|
+
"engines": {
|
|
137
|
+
"node": ">=18"
|
|
138
|
+
},
|
|
139
|
+
"packageManager": "pnpm@10.17.1",
|
|
140
|
+
"dependencies": {
|
|
141
|
+
"yaml": "^2.8.3"
|
|
142
|
+
}
|
|
143
|
+
}
|