@rbbtsn0w/adg 0.1.0-alpha.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 (84) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +308 -0
  3. package/bin/adg.ts +758 -0
  4. package/docs/agents-spec.md +132 -0
  5. package/docs/authoring.md +352 -0
  6. package/package.json +50 -0
  7. package/schemas/adg-plugin.schema.json +77 -0
  8. package/schemas/marketplace.schema.json +86 -0
  9. package/schemas/plugin-lock.schema.json +90 -0
  10. package/src/adapters/anthropic.ts +54 -0
  11. package/src/adapters/index.ts +24 -0
  12. package/src/adapters/openai.ts +37 -0
  13. package/src/adapters/reverse.ts +60 -0
  14. package/src/agents/claude.ts +124 -0
  15. package/src/agents/codex.ts +67 -0
  16. package/src/agents/index.ts +12 -0
  17. package/src/agents/registry.ts +30 -0
  18. package/src/agents/types.ts +47 -0
  19. package/src/commands/adapt.ts +36 -0
  20. package/src/commands/import.ts +69 -0
  21. package/src/commands/init.ts +146 -0
  22. package/src/commands/install.ts +411 -0
  23. package/src/commands/link.ts +61 -0
  24. package/src/commands/list.ts +28 -0
  25. package/src/commands/marketplace.ts +198 -0
  26. package/src/commands/migrate.ts +84 -0
  27. package/src/commands/multiselect-skills.ts +137 -0
  28. package/src/commands/remove.ts +136 -0
  29. package/src/commands/select-agents.ts +45 -0
  30. package/src/commands/select-components.ts +66 -0
  31. package/src/commands/select-plugins.ts +28 -0
  32. package/src/commands/select-scope.ts +21 -0
  33. package/src/commands/update.ts +85 -0
  34. package/src/commands/validate.ts +57 -0
  35. package/src/components.ts +90 -0
  36. package/src/deps.ts +64 -0
  37. package/src/fsutil.ts +38 -0
  38. package/src/hash.ts +61 -0
  39. package/src/lock.ts +57 -0
  40. package/src/manifest.ts +113 -0
  41. package/src/marketplace.ts +41 -0
  42. package/src/package.ts +74 -0
  43. package/src/paths.ts +129 -0
  44. package/src/semver.ts +67 -0
  45. package/src/skills.ts +88 -0
  46. package/src/sources.ts +159 -0
  47. package/src/types.ts +140 -0
  48. package/vendor/skills/LICENSE +29 -0
  49. package/vendor/skills/PROVENANCE.md +60 -0
  50. package/vendor/skills/ThirdPartyNoticeText.txt +117 -0
  51. package/vendor/skills/package.json +143 -0
  52. package/vendor/skills/src/add.ts +1999 -0
  53. package/vendor/skills/src/agents.ts +755 -0
  54. package/vendor/skills/src/blob.ts +567 -0
  55. package/vendor/skills/src/cli.ts +387 -0
  56. package/vendor/skills/src/constants.ts +3 -0
  57. package/vendor/skills/src/detect-agent.ts +62 -0
  58. package/vendor/skills/src/find.ts +357 -0
  59. package/vendor/skills/src/frontmatter.ts +16 -0
  60. package/vendor/skills/src/git-tree.ts +36 -0
  61. package/vendor/skills/src/git.ts +277 -0
  62. package/vendor/skills/src/install.ts +91 -0
  63. package/vendor/skills/src/installer.ts +1097 -0
  64. package/vendor/skills/src/list.ts +231 -0
  65. package/vendor/skills/src/local-lock.ts +182 -0
  66. package/vendor/skills/src/plugin-manifest.ts +183 -0
  67. package/vendor/skills/src/prompts/search-multiselect.ts +387 -0
  68. package/vendor/skills/src/providers/index.ts +14 -0
  69. package/vendor/skills/src/providers/registry.ts +51 -0
  70. package/vendor/skills/src/providers/types.ts +97 -0
  71. package/vendor/skills/src/providers/wellknown.ts +804 -0
  72. package/vendor/skills/src/remove.ts +323 -0
  73. package/vendor/skills/src/sanitize.ts +65 -0
  74. package/vendor/skills/src/self-cli.ts +20 -0
  75. package/vendor/skills/src/skill-lock.ts +329 -0
  76. package/vendor/skills/src/skills.ts +316 -0
  77. package/vendor/skills/src/source-parser.ts +438 -0
  78. package/vendor/skills/src/sync.ts +478 -0
  79. package/vendor/skills/src/telemetry.ts +186 -0
  80. package/vendor/skills/src/test-utils.ts +73 -0
  81. package/vendor/skills/src/types.ts +128 -0
  82. package/vendor/skills/src/update-source.ts +90 -0
  83. package/vendor/skills/src/update.ts +749 -0
  84. package/vendor/skills/src/use.ts +675 -0
@@ -0,0 +1,132 @@
1
+ # The `.agents/` Directory Specification
2
+
3
+ **Status:** Draft · **Schema:** [`adg-plugin.schema.json`](../schemas/adg-plugin.schema.json) (`adg.plugin/v1`) · **Steward:** ADG
4
+
5
+ `.agents/` is the canonical, vendor-neutral home for a plugin's **source**
6
+ manifest. ADG does not own a proprietary `.adg-*` format; its job is to keep the
7
+ `.agents/` directory consistent and to project it onto each runtime.
8
+
9
+ The key words MUST, SHOULD, and MAY follow RFC 2119.
10
+
11
+ ---
12
+
13
+ ## 1. Layout
14
+
15
+ A plugin is authored once under `.agents/` and projected to each runtime:
16
+
17
+ ```
18
+ asc/ # a plugin (authoring source)
19
+ ├── .agents/
20
+ │ └── .plugin.json # canonical source manifest (source of truth)
21
+ ├── skills/<name>/SKILL.md # declared payload
22
+ ├── commands/ agents/ mcp/ # declared payload
23
+ └── README.md LICENSE CHANGELOG # canonical metadata
24
+ # .claude-plugin/ , .codex-plugin/ are NOT authored here — they are runtime
25
+ # projections, generated at install time (or committed only when publishing to a
26
+ # runtime's native registry).
27
+ ```
28
+
29
+ - The source manifest lives at **`.agents/.plugin.json`**. The dot-prefixed
30
+ filename marks it as a production/source artifact; the `.agents/` directory is
31
+ the neutral namespace.
32
+ - A repo authoring a catalog of plugins MAY declare it at
33
+ **`.agents/.marketplace.json`** (schema:
34
+ [`marketplace.schema.json`](../schemas/marketplace.schema.json)).
35
+ - Runtime **projections** (`.claude-plugin/`, `.codex-plugin/`) are NOT authoring
36
+ artifacts: `adg plugins add` generates them into the consumer tree at install
37
+ time. They are committed in a source repo only to publish to a runtime's native
38
+ registry (via `adg plugins adapt`), and MUST NOT be hand-edited.
39
+
40
+ ### Legacy fallback
41
+
42
+ The previous location `.adg-plugin/plugin.json` is **deprecated** but still read:
43
+ `readManifest` and discovery (`scanPlugins`) prefer `.agents/.plugin.json` and
44
+ fall back to `.adg-plugin/plugin.json` (`src/manifest.ts:findManifestFile`). New
45
+ plugins MUST use `.agents/.plugin.json`.
46
+
47
+ ### Consumption is unchanged
48
+
49
+ Installed plugins still land under `.agents/plugins/` (`src/paths.ts`), and the
50
+ Codex/Claude-facing export keeps its plain name —
51
+ `.agents/plugins/marketplace.json` and `.claude-plugin/marketplace.json`. These
52
+ are **runtime exports**, distinct from a source `.agents/.marketplace.json`, and
53
+ MUST keep their plain filenames so the runtimes discover them.
54
+
55
+ ---
56
+
57
+ ## 2. Manifest — `.agents/.plugin.json`
58
+
59
+ The manifest stores **path pointers**, never inlined payload; the same payload
60
+ directory (e.g. `./skills/`) is referenced by the source manifest and reused by
61
+ every projection. See the schema for the full field set; the load-bearing fields:
62
+
63
+ ```jsonc
64
+ {
65
+ "schemaVersion": "adg.plugin/v1",
66
+ "name": "asc", // kebab-case (REQUIRED)
67
+ "version": "0.1.0", // semver (REQUIRED)
68
+ "description": "App Store Connect …", // non-empty (REQUIRED)
69
+ "skills": "./skills/", // string (dir) | array (explicit)
70
+ "commands": "./commands/",
71
+ "agents": "./agents/",
72
+ "mcp": "./mcp/.mcp.json",
73
+ "dependencies": [{ "name": "github-cr", "version": "^0.2.0" }],
74
+ "strict": true
75
+ }
76
+ ```
77
+
78
+ Projection output paths (`.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`)
79
+ are ADG-internal conventions, not declared in the manifest.
80
+
81
+ ---
82
+
83
+ ## 3. Packaging — manifest-driven allowlist
84
+
85
+ When a plugin is installed (copied/cloned), only its **declared payload** ships;
86
+ the authoring repo's dev files (`src/`, `test/`, `docs/`, CI config, …) are left
87
+ behind. This is default-deny — safer (no accidental secret/dev-file leakage) and
88
+ consistent with the content hash.
89
+
90
+ The packaged file set (`src/package.ts:packagedRoots` / `packageFilter`) is:
91
+
92
+ - the `.agents/` manifest home (and legacy `.adg-plugin/` during deprecation);
93
+ - the top-level directory of every declared component
94
+ (`skills`/`commands`/`agents`/`mcp`/`hooks`/`apps`);
95
+ - canonical metadata at the root: `README*`, `LICENSE*`, `CHANGELOG*`, `NOTICE*`;
96
+ - the runtime projections `.claude-plugin/`, `.codex-plugin/` when present (copy
97
+ only) — at install they are regenerated into the destination regardless.
98
+
99
+ The **same** allowlist drives both the copy (`copyPluginDir`) and the content
100
+ hash (`folderHash`), so an in-place plugin (copy skipped) and a copied install
101
+ hash identically. Projections are excluded from the hash so re-adapting does not
102
+ churn it.
103
+
104
+ A plugin needing finer exclusion *within* a component directory SHOULD use git's
105
+ native `.gitattributes export-ignore` rather than a bespoke ignore format.
106
+
107
+ ---
108
+
109
+ ## 4. Consistency (the `validate` gate)
110
+
111
+ `adg plugins validate` is the gate for any source manifest — whether authored by
112
+ a human or generated by an agent. Beyond JSON-schema validity it SHOULD enforce:
113
+
114
+ - **Pointer integrity** — every path pointer (`skills`/`commands`/`agents`/
115
+ `mcp`/`hooks`/`apps`) resolves; every referenced `SKILL.md` has a non-empty
116
+ `name` and `description`.
117
+ - **Projection sync** — *if* a source repo commits projections (to publish to a
118
+ native registry), they must match a fresh projection of the current
119
+ `.agents/.plugin.json` (no hand-edited drift). Absent projections are fine.
120
+ - **Dependency resolvability** — each `dependencies[]` entry resolves to a known
121
+ plugin in the reachable catalog(s).
122
+
123
+ ---
124
+
125
+ ## 5. Migration from `.adg-plugin/`
126
+
127
+ 1. Move `.adg-plugin/plugin.json` → `.agents/.plugin.json` (content unchanged).
128
+ 2. Run `adg plugins update` so lock `folderHash` values reflect the new layout.
129
+ 3. `adg plugins validate` to confirm. (Re-run `adg plugins adapt` only if you
130
+ commit projections for a native registry.)
131
+
132
+ ADG reads the legacy `.adg-plugin/plugin.json` for one release to ease the move.
@@ -0,0 +1,352 @@
1
+ # Authoring an ADG Plugin
2
+
3
+ A practical guide for **producers**: how to write the `.agents/.plugin.json` DSL,
4
+ declare your components, and hand the result to users.
5
+
6
+ For the normative directory rules see [agents-spec.md](agents-spec.md); the JSON
7
+ Schema is [`schemas/adg-plugin.schema.json`](../schemas/adg-plugin.schema.json).
8
+
9
+ ---
10
+
11
+ ## TL;DR
12
+
13
+ You author **only** `.agents/` artifacts. The runtime projections
14
+ (`.claude-plugin/`, `.codex-plugin/`) are **not** something you generate or
15
+ commit by default — ADG produces them at install time, into the consumer's tree.
16
+
17
+ ```bash
18
+ adg plugins init my-plugin # scaffold .agents/.plugin.json + a skill + README
19
+ # ... edit .agents/.plugin.json: DECLARE every component you ship ...
20
+ adg plugins validate my-plugin # check structure + that declared paths exist
21
+ git add -A && git commit # commit the .agents/ source only
22
+ ```
23
+
24
+ Scaffold what you need (the authoring axis is the artifact *kind*, not a runtime):
25
+
26
+ ```bash
27
+ adg plugins init my-plugin # a plugin → .agents/.plugin.json (default)
28
+ adg plugins init my-catalog --type marketplace # a catalog → .agents/.marketplace.json
29
+ adg plugins init my-kit --type all # catalog + one starter member plugin
30
+ ```
31
+
32
+ A finished plugin on disk — **`.agents/` only**:
33
+
34
+ ```
35
+ my-plugin/
36
+ ├── .agents/.plugin.json # ← source of truth (you edit this)
37
+ ├── skills/<name>/SKILL.md # payload
38
+ ├── commands/ agents/ mcp/ # payload (only if declared!)
39
+ └── README.md LICENSE CHANGELOG
40
+ ```
41
+
42
+ > **The one rule that bites everyone:** packaging and projection are
43
+ > **default-deny**. A directory that exists on disk but is **not declared** in
44
+ > `.agents/.plugin.json` is neither projected to a runtime nor shipped to users.
45
+ > Declare it, or it does not exist.
46
+
47
+ ### Where do `.claude-plugin/` and `.codex-plugin/` come from, then?
48
+
49
+ They are **runtime projections** — a consumption/publish concern, not an
50
+ authoring artifact:
51
+
52
+ - **On install**, `adg plugins add` generates them into the consumer's
53
+ `.agents/plugins/<name>/` so Claude Code and Codex can discover the plugin. You
54
+ do nothing.
55
+ - **Only if you publish to a runtime's own native registry** (e.g. a Claude
56
+ marketplace that reads `.claude-plugin/` straight from your git repo) do you
57
+ run `adg plugins adapt [--target claude|codex|all]` and commit the result.
58
+ Otherwise leave them out of your source repo.
59
+
60
+ `--target` selects which *runtime* to project for; it is unrelated to the
61
+ `init --type` artifact kind above.
62
+
63
+ ---
64
+
65
+ ## The `.agents/.plugin.json` DSL
66
+
67
+ ```jsonc
68
+ {
69
+ "schemaVersion": "adg.plugin/v1", // REQUIRED — exact constant
70
+ "name": "asc", // REQUIRED — kebab-case
71
+ "version": "0.1.0", // REQUIRED — semver
72
+ "description": "App Store Connect workflows.",// REQUIRED — non-empty
73
+
74
+ "author": { "name": "You", "url": "…", "email": "…" },
75
+ "license": "MIT",
76
+ "category": "Developer Tools",
77
+ "interface": { "displayName": "ASC", "icon": "asc.png" },
78
+
79
+ // ── Components: path pointers, never inlined content ──
80
+ "skills": "./skills/", // string (root dir) | string[] (explicit paths)
81
+ "commands": "./commands/", // string (dir)
82
+ "agents": "./agents/", // string (dir)
83
+ "hooks": "./hooks/", // string (dir)
84
+ "apps": "./apps/", // string (dir)
85
+ "mcp": "./mcp/.mcp.json", // string (file)
86
+
87
+ "dependencies": [{ "name": "github-cr", "version": "^0.2.0" }],
88
+ "strict": true, // default true (see Skills)
89
+
90
+ "homepage": "https://github.com/you/asc",
91
+ "changelog": "CHANGELOG.md"
92
+ }
93
+ ```
94
+
95
+ > Output paths for the runtime projections (`.claude-plugin/plugin.json`,
96
+ > `.codex-plugin/plugin.json`) are **ADG-internal conventions** mandated by each
97
+ > runtime — they are not configurable from the manifest, so there is no
98
+ > `adapters` field to declare.
99
+
100
+ ### Field reference
101
+
102
+ | Field | Type | Required | Notes |
103
+ |-------|------|:--------:|-------|
104
+ | `schemaVersion` | `"adg.plugin/v1"` | ✅ | Must equal the constant exactly. |
105
+ | `name` | string | ✅ | `^[a-z0-9]+(-[a-z0-9]+)*$` (kebab-case). |
106
+ | `version` | string | ✅ | Semantic version, e.g. `1.2.3`, `1.0.0-rc.1`. |
107
+ | `description` | string | ✅ | Non-empty; this is what an agent reads to decide relevance. |
108
+ | `author` | `{ name, url?, email? }` | | |
109
+ | `license` | string | | SPDX id, e.g. `MIT`. |
110
+ | `category` | string | | Free-form, e.g. `Developer Tools`. |
111
+ | `interface` | `{ displayName?, icon? }` | | Presentation only. |
112
+ | `skills` | string \| string[] | | Root dir (auto-scan) or explicit skill paths. |
113
+ | `commands` | string | | Directory of slash-command `.md` files. |
114
+ | `agents` | string | | Directory of sub-agent `.md` files. |
115
+ | `hooks` | string | | Directory of lifecycle hooks. |
116
+ | `apps` | string | | Directory of third-party app integration config. |
117
+ | `mcp` | string | | Path to an MCP config file (e.g. `./mcp/.mcp.json`). |
118
+ | `dependencies` | `[{ name, version }]` | | Other plugins required; `version` is a semver range. |
119
+ | `strict` | boolean | | Default `true`. See **Skills**. |
120
+ | `homepage`, `changelog` | string | | |
121
+
122
+ ---
123
+
124
+ ## Skills
125
+
126
+ A skill is a directory under your skills root with a `SKILL.md` whose front
127
+ matter carries a `name` and a `description`:
128
+
129
+ ```markdown
130
+ ---
131
+ name: metadata-sync
132
+ description: Pull and push canonical App Store metadata.
133
+ ---
134
+
135
+ # metadata-sync
136
+ Use when synchronizing App Store listing metadata…
137
+ ```
138
+
139
+ Two ways to declare them:
140
+
141
+ - **Auto-discover (recommended, `strict: true`)** — set `"skills": "./skills/"`.
142
+ Every sub-directory of `skills/` that contains a `SKILL.md` is exposed. The
143
+ projection passes the directory through so each runtime discovers them.
144
+ - **Explicit bundle (`strict: false`)** — list paths:
145
+ `"skills": ["./skills/metadata-sync", "./skills/testflight-upload"]`. The
146
+ projection emits an explicit `./skills/<name>` list. Use this when you need a
147
+ fixed, curated set (this is also what `adg plugins import-skills` produces).
148
+
149
+ ---
150
+
151
+ ## Other components
152
+
153
+ - **commands** — `"./commands/"`, a dir of slash-command markdown files.
154
+ - **agents** — `"./agents/"`, a dir of sub-agent definition `.md` files.
155
+ - **mcp** — `"./mcp/.mcp.json"`, an MCP server config file (points at a *file*,
156
+ not a dir).
157
+ - **hooks**, **apps** — directories, same pattern.
158
+
159
+ Declare only what you ship. Omit a field and that component is absent from both
160
+ the runtime projections and the installed package.
161
+
162
+ ---
163
+
164
+ ## Dependencies
165
+
166
+ ```jsonc
167
+ "dependencies": [{ "name": "github-cr", "version": "^0.2.0" }]
168
+ ```
169
+
170
+ When a user installs your plugin, ADG resolves dependencies in dependency-first
171
+ order from the same source/catalog. Names must resolve to a known plugin; an
172
+ unresolved name fails the install.
173
+
174
+ ---
175
+
176
+ ## What gets packaged (and what does not)
177
+
178
+ Installing/cloning a plugin ships a **manifest-driven allowlist**, never the
179
+ whole repo:
180
+
181
+ **Shipped**
182
+ - `.agents/.plugin.json` (the manifest);
183
+ - the top-level directory of every **declared** component;
184
+ - root metadata: `README*`, `LICENSE*`, `CHANGELOG*`, `NOTICE*`;
185
+ - the runtime projections `.claude-plugin/`, `.codex-plugin/` — generated at
186
+ install time (or committed by you only if publishing to a native registry).
187
+
188
+ **Left behind**
189
+ - `src/`, `test/`, `docs/`, build output, CI config;
190
+ - `.git`, `node_modules`, `.DS_Store`;
191
+ - `.env` and any other secret/dev files;
192
+ - **any directory you forgot to declare.**
193
+
194
+ Need to exclude something *inside* a declared component dir? Use git's native
195
+ `.gitattributes export-ignore` rather than inventing an ignore file.
196
+
197
+ ---
198
+
199
+ ## Authoring by hand (no CLI)
200
+
201
+ The CLI is convenience; the format is plain files. To produce a plugin manually:
202
+
203
+ 1. Create the directory and write `.agents/.plugin.json` (above).
204
+ 2. Add your payload: `skills/<name>/SKILL.md`, `commands/…`, etc. — and declare
205
+ each in the manifest.
206
+ 3. Run `adg plugins validate <dir>`.
207
+
208
+ That is the whole authoring artifact. You do **not** generate `.claude-plugin/`
209
+ or `.codex-plugin/` — those are produced for you at install time. Only if you
210
+ publish to a runtime's native registry do you run `adg plugins adapt <dir>
211
+ [--target claude|codex|all]` and commit the result; the output is deterministic,
212
+ so never hand-edit it.
213
+
214
+ ---
215
+
216
+ ## Multiple plugins in one repo — the `marketplace.json` DSL
217
+
218
+ A repo can hold many plugins. Each plugin is self-contained (its own
219
+ `.agents/.plugin.json`); the repo declares a **catalog** at the root:
220
+
221
+ ```
222
+ my-plugins/
223
+ ├── .agents/.marketplace.json # catalog: lists member plugins
224
+ ├── asc/
225
+ │ └── .agents/.plugin.json
226
+ └── github-cr/
227
+ └── .agents/.plugin.json
228
+ ```
229
+
230
+ ### Two roles, one shape
231
+
232
+ `marketplace.json` appears in two contexts with the **same structure** but
233
+ different semantics:
234
+
235
+ | Role | Location | Written by | Read by |
236
+ |------|----------|------------|---------|
237
+ | **Source catalog** | `<repo>/.agents/.marketplace.json` (dot-prefixed) | **you (by hand)** | declares the members of a multi-plugin repo |
238
+ | **Runtime export** | `<root>/.agents/plugins/marketplace.json` (plain) | ADG `add` (generated) | Codex / Claude discovery |
239
+
240
+ You author the **source catalog**; ADG generates the runtime export. The schema
241
+ is [`marketplace.schema.json`](../schemas/marketplace.schema.json).
242
+
243
+ ### Structure
244
+
245
+ Keep the authored catalog minimal — a member is just a `name` and a `source`.
246
+ Do **not** repeat `version` / `description` / `author` here; those live in each
247
+ plugin's `.agents/.plugin.json` and would only drift if duplicated.
248
+
249
+ ```jsonc
250
+ {
251
+ "name": "my-plugins", // REQUIRED — catalog name (Codex uses it as the marketplace name)
252
+ "description": "My Apple plugins", // optional
253
+ "owner": { "name": "You" }, // optional
254
+
255
+ "plugins": [ // REQUIRED — members
256
+ { "name": "asc", "source": "./asc" }, // local shorthand
257
+ { "name": "github-cr", "source": "./github-cr", "category": "Dev Tools" }
258
+ ]
259
+ }
260
+ ```
261
+
262
+ | Field | Type | Required | Notes |
263
+ |-------|------|:--------:|-------|
264
+ | `name` | string | ✅ | Catalog id; Codex treats it as the marketplace name. |
265
+ | `description` | string | | Catalog summary (replaces the old `interface.displayName`). |
266
+ | `owner` | `{ name?, email?, url? }` | | |
267
+ | `plugins[].name` | string | ✅ | Must match the member's `.agents/.plugin.json` `name`. |
268
+ | `plugins[].source` | string \| object | ✅ | String = local path; object = explicit/remote (below). |
269
+ | `plugins[].category` | string | | Free-form. |
270
+ | `plugins[].policy` | object | | **Export-only** — ADG writes it for Codex; omit when authoring. |
271
+
272
+ The reader is tolerant: only `name` (string) and `plugins` (array) are checked,
273
+ and **unknown fields are preserved**.
274
+
275
+ ### `source` — string shorthand or object
276
+
277
+ ```jsonc
278
+ "source": "./asc" // local path shorthand
279
+ "source": { "source": "local", "path": "./asc" } // explicit local
280
+ "source": { "source": "github", "repo": "you/asc", "ref": "v0.1.0", "path": "plugins/asc" }
281
+ "source": { "source": "git", "url": "https://example.com/asc.git", "path": "." }
282
+ ```
283
+
284
+ A **local path** (string, or `local.path`) is resolved relative to the
285
+ **grandparent** of the catalog file — the directory that contains `.agents/`
286
+ (this matches how `codex plugin add` resolves entries; see
287
+ `paths.ts:marketplaceSourcePath`). So in `<repo>/.agents/.marketplace.json`,
288
+ `"./asc"` points at `<repo>/asc`.
289
+
290
+ > Remote forms (`github` / `git`) are part of the schema for forward
291
+ > compatibility. ADG's generated runtime export always uses the explicit
292
+ > `local` object; actually *fetching* a remote catalog member on `add` is a
293
+ > separate consumption feature, not yet wired.
294
+
295
+ Users install one (`adg plugins add <repo> --plugin asc`) or all (`--all`).
296
+ Discovery also works **without** a catalog — ADG scans for `.agents/.plugin.json`
297
+ files.
298
+
299
+ ---
300
+
301
+ ## Validate & common errors
302
+
303
+ `adg plugins validate <dir>` checks, in order:
304
+
305
+ 1. `.agents/.plugin.json` exists and is valid JSON;
306
+ 2. structural validity (required fields, kebab `name`, semver `version`, types);
307
+ 3. **every declared path exists** (`agents`/`commands`/`apps`/`hooks`/`mcp` dirs
308
+ or files; the `skills` root, or each explicit skill path).
309
+
310
+ Typical failures:
311
+
312
+ | Message | Fix |
313
+ |---------|-----|
314
+ | `schemaVersion must be "adg.plugin/v1"` | Set the constant exactly. |
315
+ | `name is required and must be kebab-case` | e.g. `my-plugin`, not `MyPlugin`. |
316
+ | `commands points to "./commands/" which does not exist` | Create the dir or drop the field. |
317
+ | `skills root "./skills/" does not exist` | Add the dir, or list explicit skill paths. |
318
+
319
+ ---
320
+
321
+ ## Publishing & how users consume it
322
+
323
+ Push the repo — just the `.agents/` source. A user installs with:
324
+
325
+ ```bash
326
+ adg plugins add github.com/you/my-plugin # or owner/repo, or a local path
327
+ adg plugins add github.com/you/my-plugin --global # ~/.agents/plugins instead of project
328
+ ```
329
+
330
+ After install, the user's tree looks like this — ADG generates the projections
331
+ here, at consumption time:
332
+
333
+ ```
334
+ <project>/.agents/plugins/
335
+ ├── my-plugin/ # your declared payload + generated projections
336
+ │ ├── .agents/.plugin.json
337
+ │ ├── .claude-plugin/plugin.json
338
+ │ ├── .codex-plugin/plugin.json
339
+ │ └── skills/<name>/SKILL.md
340
+ ├── .plugin-lock.json # ADG control plane (provenance, sha256, deps)
341
+ ├── marketplace.json # Codex-facing discovery export
342
+ └── .claude-plugin/marketplace.json # Claude-facing discovery export
343
+ ```
344
+
345
+ The runtimes (Claude, Codex) discover the plugin through their respective
346
+ `marketplace.json`; you do not need to configure them by hand.
347
+
348
+ ### Legacy note
349
+
350
+ Plugins authored under the old `.adg-plugin/plugin.json` layout still install
351
+ (it is read as a deprecated fallback). Migrate by moving the file to
352
+ `.agents/.plugin.json`, then re-running `adapt` and `validate`.
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@rbbtsn0w/adg",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org/"
10
+ },
11
+ "bin": {
12
+ "adg": "./bin/adg.ts"
13
+ },
14
+ "engines": {
15
+ "node": ">=22.18.0"
16
+ },
17
+ "scripts": {
18
+ "adg": "node ./bin/adg.ts",
19
+ "test": "node --test 'test/**/*.test.ts'",
20
+ "typecheck": "tsc --noEmit",
21
+ "prepare": "npm run typecheck"
22
+ },
23
+ "files": [
24
+ "bin",
25
+ "src",
26
+ "schemas",
27
+ "vendor",
28
+ "docs"
29
+ ],
30
+ "comment:dependencies": "Runtime deps below are required only by the vendored skills CLI (vendor/skills). ADG's own plugins code has zero runtime deps.",
31
+ "dependencies": {
32
+ "@clack/prompts": "^0.7.0",
33
+ "@vercel/detect-agent": "^1.2.3",
34
+ "picocolors": "^1.0.0",
35
+ "simple-git": "^3.0.0",
36
+ "xdg-basedir": "^5.1.0",
37
+ "yaml": "^2.8.3"
38
+ },
39
+ "devDependencies": {
40
+ "@semantic-release/changelog": "^6.0.3",
41
+ "@semantic-release/commit-analyzer": "^13.0.1",
42
+ "@semantic-release/git": "^10.0.1",
43
+ "@semantic-release/github": "^12.0.8",
44
+ "@semantic-release/npm": "^13.1.5",
45
+ "@semantic-release/release-notes-generator": "^14.1.1",
46
+ "@types/node": "^22.0.0",
47
+ "semantic-release": "^25.0.5",
48
+ "typescript": "^5.6.0"
49
+ }
50
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://RbBtSn0w.dev/schemas/adg-plugin.schema.json",
4
+ "title": "ADG Plugin Manifest",
5
+ "description": "Universal plugin manifest stored at .agents/.plugin.json. Source of truth for runtime-specific adapter manifests.",
6
+ "type": "object",
7
+ "required": ["schemaVersion", "name", "version", "description"],
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "type": "string",
12
+ "description": "Manifest schema version.",
13
+ "const": "adg.plugin/v1"
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "description": "Plugin identifier in kebab-case.",
18
+ "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
19
+ },
20
+ "version": {
21
+ "type": "string",
22
+ "description": "Semantic version.",
23
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z-.]+)?(?:\\+[0-9A-Za-z-.]+)?$"
24
+ },
25
+ "description": { "type": "string", "minLength": 1 },
26
+ "author": {
27
+ "type": "object",
28
+ "properties": {
29
+ "name": { "type": "string" },
30
+ "url": { "type": "string" },
31
+ "email": { "type": "string" }
32
+ },
33
+ "additionalProperties": false
34
+ },
35
+ "license": { "type": "string" },
36
+ "category": { "type": "string" },
37
+ "interface": {
38
+ "type": "object",
39
+ "properties": {
40
+ "displayName": { "type": "string" },
41
+ "icon": { "type": "string" }
42
+ },
43
+ "additionalProperties": true
44
+ },
45
+ "skills": {
46
+ "description": "Skill root directory, or an explicit array of skill paths.",
47
+ "oneOf": [
48
+ { "type": "string" },
49
+ { "type": "array", "items": { "type": "string" } }
50
+ ]
51
+ },
52
+ "agents": { "type": "string", "description": "Sub-agent directory." },
53
+ "commands": { "type": "string", "description": "Slash command directory." },
54
+ "apps": { "type": "string", "description": "Third-party app integration config." },
55
+ "hooks": { "type": "string", "description": "Lifecycle hooks directory." },
56
+ "mcp": { "type": "string", "description": "MCP config file path." },
57
+ "dependencies": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "object",
61
+ "required": ["name", "version"],
62
+ "properties": {
63
+ "name": { "type": "string" },
64
+ "version": { "type": "string" }
65
+ },
66
+ "additionalProperties": false
67
+ }
68
+ },
69
+ "strict": {
70
+ "type": "boolean",
71
+ "description": "When true, only skills listed in the manifest are exposed; when false, the skills directory is auto-scanned.",
72
+ "default": true
73
+ },
74
+ "homepage": { "type": "string" },
75
+ "changelog": { "type": "string" }
76
+ }
77
+ }