@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.
Files changed (110) hide show
  1. package/dist/bin/adg.js +703 -0
  2. package/dist/src/adapters/anthropic.js +54 -0
  3. package/dist/src/adapters/index.js +10 -0
  4. package/dist/src/adapters/openai.js +30 -0
  5. package/dist/src/adapters/reverse.js +53 -0
  6. package/dist/src/agents/claude.js +118 -0
  7. package/dist/src/agents/codex.js +61 -0
  8. package/{src/agents/index.ts → dist/src/agents/index.js} +6 -8
  9. package/dist/src/agents/registry.js +24 -0
  10. package/dist/src/agents/types.js +1 -0
  11. package/dist/src/commands/adapt.js +26 -0
  12. package/dist/src/commands/import.js +51 -0
  13. package/dist/src/commands/init.js +104 -0
  14. package/dist/src/commands/install.js +257 -0
  15. package/dist/src/commands/link.js +34 -0
  16. package/dist/src/commands/list.js +19 -0
  17. package/dist/src/commands/marketplace.js +124 -0
  18. package/dist/src/commands/migrate.js +60 -0
  19. package/dist/src/commands/multiselect-skills.js +103 -0
  20. package/dist/src/commands/remove.js +102 -0
  21. package/dist/src/commands/select-agents.js +40 -0
  22. package/dist/src/commands/select-components.js +61 -0
  23. package/dist/src/commands/select-plugins.js +25 -0
  24. package/dist/src/commands/select-scope.js +20 -0
  25. package/dist/src/commands/update.js +50 -0
  26. package/dist/src/commands/validate.js +50 -0
  27. package/dist/src/components.js +90 -0
  28. package/dist/src/deps.js +46 -0
  29. package/dist/src/fsutil.js +32 -0
  30. package/dist/src/hash.js +51 -0
  31. package/dist/src/lock.js +51 -0
  32. package/dist/src/manifest.js +110 -0
  33. package/dist/src/marketplace.js +39 -0
  34. package/{src/package.ts → dist/src/package.js} +37 -42
  35. package/{src/paths.ts → dist/src/paths.js} +54 -60
  36. package/dist/src/semver.js +55 -0
  37. package/dist/src/skills.js +79 -0
  38. package/dist/src/sources.js +122 -0
  39. package/dist/src/types.js +19 -0
  40. package/dist/vendor/skills/package.json +143 -0
  41. package/dist/vendor/skills/src/add.js +1663 -0
  42. package/dist/vendor/skills/src/agents.js +729 -0
  43. package/dist/vendor/skills/src/blob.js +436 -0
  44. package/dist/vendor/skills/src/cli.js +340 -0
  45. package/dist/vendor/skills/src/constants.js +3 -0
  46. package/dist/vendor/skills/src/detect-agent.js +56 -0
  47. package/dist/vendor/skills/src/find.js +294 -0
  48. package/dist/vendor/skills/src/frontmatter.js +13 -0
  49. package/dist/vendor/skills/src/git-tree.js +32 -0
  50. package/dist/vendor/skills/src/git.js +235 -0
  51. package/dist/vendor/skills/src/install.js +75 -0
  52. package/dist/vendor/skills/src/installer.js +924 -0
  53. package/dist/vendor/skills/src/list.js +201 -0
  54. package/dist/vendor/skills/src/local-lock.js +109 -0
  55. package/dist/vendor/skills/src/plugin-manifest.js +152 -0
  56. package/dist/vendor/skills/src/prompts/search-multiselect.js +312 -0
  57. package/dist/vendor/skills/src/providers/index.js +4 -0
  58. package/dist/vendor/skills/src/providers/registry.js +42 -0
  59. package/dist/vendor/skills/src/providers/types.js +1 -0
  60. package/dist/vendor/skills/src/providers/wellknown.js +625 -0
  61. package/dist/vendor/skills/src/remove.js +263 -0
  62. package/dist/vendor/skills/src/sanitize.js +57 -0
  63. package/dist/vendor/skills/src/self-cli.js +15 -0
  64. package/dist/vendor/skills/src/skill-lock.js +237 -0
  65. package/dist/vendor/skills/src/skills.js +264 -0
  66. package/dist/vendor/skills/src/source-parser.js +367 -0
  67. package/dist/vendor/skills/src/sync.js +404 -0
  68. package/dist/vendor/skills/src/telemetry.js +101 -0
  69. package/dist/vendor/skills/src/test-utils.js +59 -0
  70. package/dist/vendor/skills/src/types.js +1 -0
  71. package/dist/vendor/skills/src/update-source.js +76 -0
  72. package/dist/vendor/skills/src/update.js +590 -0
  73. package/dist/vendor/skills/src/use.js +505 -0
  74. package/package.json +15 -7
  75. package/bin/adg.ts +0 -758
  76. package/src/adapters/anthropic.ts +0 -54
  77. package/src/adapters/index.ts +0 -24
  78. package/src/adapters/openai.ts +0 -37
  79. package/src/adapters/reverse.ts +0 -60
  80. package/src/agents/claude.ts +0 -124
  81. package/src/agents/codex.ts +0 -67
  82. package/src/agents/registry.ts +0 -30
  83. package/src/agents/types.ts +0 -47
  84. package/src/commands/adapt.ts +0 -36
  85. package/src/commands/import.ts +0 -69
  86. package/src/commands/init.ts +0 -146
  87. package/src/commands/install.ts +0 -411
  88. package/src/commands/link.ts +0 -61
  89. package/src/commands/list.ts +0 -28
  90. package/src/commands/marketplace.ts +0 -198
  91. package/src/commands/migrate.ts +0 -84
  92. package/src/commands/multiselect-skills.ts +0 -137
  93. package/src/commands/remove.ts +0 -136
  94. package/src/commands/select-agents.ts +0 -45
  95. package/src/commands/select-components.ts +0 -66
  96. package/src/commands/select-plugins.ts +0 -28
  97. package/src/commands/select-scope.ts +0 -21
  98. package/src/commands/update.ts +0 -85
  99. package/src/commands/validate.ts +0 -57
  100. package/src/components.ts +0 -90
  101. package/src/deps.ts +0 -64
  102. package/src/fsutil.ts +0 -38
  103. package/src/hash.ts +0 -61
  104. package/src/lock.ts +0 -57
  105. package/src/manifest.ts +0 -113
  106. package/src/marketplace.ts +0 -41
  107. package/src/semver.ts +0 -67
  108. package/src/skills.ts +0 -88
  109. package/src/sources.ts +0 -159
  110. 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
+ }