@rbbtsn0w/adg 0.4.0-beta.9 → 0.5.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/dist/bin/adg.js +79 -21
- package/dist/src/adapters/antigravity-hooks.js +2 -1
- package/dist/src/agents/antigravity.js +8 -6
- package/dist/src/agents/base.js +44 -12
- package/dist/src/sources.js +28 -1
- package/dist/src/telemetry.js +76 -0
- package/dist/vendor/skills/src/telemetry.js +88 -64
- package/dist/vendor/skills/src/update.js +79 -10
- package/docs/agents/antigravity.md +148 -0
- package/docs/agents/claude.md +113 -0
- package/docs/agents/codex.md +89 -0
- package/docs/agents-spec.md +172 -0
- package/package.json +7 -1
- package/vendor/skills/PROVENANCE.md +3 -2
- package/vendor/skills/src/telemetry.ts +108 -124
- package/vendor/skills/src/update.ts +85 -18
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Antigravity (Gemini / agy) — Adapter Specification
|
|
2
|
+
|
|
3
|
+
> Based on the [Agent Adapter Template](../agents-spec.md#7-agent-adapter-template).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Official References
|
|
8
|
+
|
|
9
|
+
- Plugin docs: <https://antigravity.google/docs/cli/plugins>
|
|
10
|
+
- **Note**: Antigravity has a convention-based discovery model. There is no rich
|
|
11
|
+
manifest schema — plugins are discovered by directory structure and file presence.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Projection Output
|
|
16
|
+
|
|
17
|
+
- Output directory: Plugin root (no subdirectory)
|
|
18
|
+
- Manifest file: `plugin.json` (at plugin root)
|
|
19
|
+
- MCP config: `mcp_config.json` (at plugin root, copied from source `.mcp.json`)
|
|
20
|
+
- Hooks config: `hooks.json` (at plugin root, translated from canonical format)
|
|
21
|
+
- Runner script: `.antigravity-plugin/hook-runner.mjs` (generated bridge)
|
|
22
|
+
- Adapter source: [`src/adapters/antigravity.ts`](../../src/adapters/antigravity.ts),
|
|
23
|
+
[`src/adapters/antigravity-hooks.ts`](../../src/adapters/antigravity-hooks.ts)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 3. Manifest Schema
|
|
28
|
+
|
|
29
|
+
Required fields: `name` only.
|
|
30
|
+
|
|
31
|
+
The projected `plugin.json` contains **only the plugin name**. All other metadata
|
|
32
|
+
is discovered by convention (presence of sibling directories/files).
|
|
33
|
+
|
|
34
|
+
```jsonc
|
|
35
|
+
// Projected plugin.json — minimal by design
|
|
36
|
+
{ "name": "my-plugin" }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 4. Supported Components
|
|
42
|
+
|
|
43
|
+
| Component | Supported | Manifest Key | Discovery Mechanism |
|
|
44
|
+
| :--- | :---: | :--- | :--- |
|
|
45
|
+
| Skills | ✅ | — | Auto-scan `skills/` dir for sub-dirs with `SKILL.md` |
|
|
46
|
+
| Agents | ✅ | — | Auto-scan `agents/` dir |
|
|
47
|
+
| Commands | ✅ | — | Auto-scan `commands/` dir |
|
|
48
|
+
| Hooks | ✅ | — | Root `hooks.json` file (native schema) |
|
|
49
|
+
| MCP | ✅ | — | Root `mcp_config.json` file |
|
|
50
|
+
| Apps | ❌ | — | Not supported by Antigravity |
|
|
51
|
+
|
|
52
|
+
**Key difference**: Antigravity does NOT read the manifest for component paths.
|
|
53
|
+
It discovers components purely by scanning known directory names and file names at the
|
|
54
|
+
plugin root. The ADG adapter materializes files at these conventional locations.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 5. Skills
|
|
59
|
+
|
|
60
|
+
- **Declared form**: No manifest field. Antigravity scans `skills/` at the plugin root.
|
|
61
|
+
- **Strict mode**: N/A — always auto-discovers. No explicit skill list in manifest.
|
|
62
|
+
- **Array encoding**: N/A — not declared in manifest.
|
|
63
|
+
- **Auto-discovery**: Scans `skills/` for sub-dirs containing `SKILL.md`. Each sub-dir's
|
|
64
|
+
`SKILL.md` YAML frontmatter provides `name` and `description`.
|
|
65
|
+
- **SKILL.md structure**: Identical across all agents:
|
|
66
|
+
```
|
|
67
|
+
skills/<name>/
|
|
68
|
+
└── SKILL.md # Required: YAML frontmatter (name, description) + body
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 6. MCP Servers
|
|
74
|
+
|
|
75
|
+
- **Config file name**: `mcp_config.json` (at plugin root — required conventional name).
|
|
76
|
+
- **Config key**: N/A (no manifest key; discovered by file presence).
|
|
77
|
+
- **Special handling**: ADG copies (or symlinks) the source `.mcp.json` to
|
|
78
|
+
`mcp_config.json` at the plugin root. If the source IS already `mcp_config.json`,
|
|
79
|
+
no copy is performed.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 7. Hooks
|
|
84
|
+
|
|
85
|
+
- **Canonical file**: Root `hooks.json` — Antigravity's only hook discovery point.
|
|
86
|
+
- **Native override**: `hooks/hooks-antigravity.json` — validated and copied verbatim,
|
|
87
|
+
bypassing Claude-to-Antigravity translation.
|
|
88
|
+
- **Supported events** (4 total):
|
|
89
|
+
`PreInvocation` (← SessionStart), `PreToolUse`, `PostToolUse`, `Stop`
|
|
90
|
+
- **Event mapping** (Claude → Antigravity):
|
|
91
|
+
|
|
92
|
+
| Claude Event | Antigravity Event | Notes |
|
|
93
|
+
| :--- | :--- | :--- |
|
|
94
|
+
| `SessionStart` | `PreInvocation` | Only fires when `invocationNum === 0` (runner filters) |
|
|
95
|
+
| `PreToolUse` | `PreToolUse` | Tool groups with matcher |
|
|
96
|
+
| `PostToolUse` | `PostToolUse` | Tool groups with matcher |
|
|
97
|
+
| `Stop` | `Stop` | Direct event |
|
|
98
|
+
|
|
99
|
+
- **Tool name aliases** (Claude → Antigravity):
|
|
100
|
+
|
|
101
|
+
| Claude Tool | Antigravity Tool(s) |
|
|
102
|
+
| :--- | :--- |
|
|
103
|
+
| `Bash` | `run_command` |
|
|
104
|
+
| `Read` | `view_file` |
|
|
105
|
+
| `Write` | `write_to_file` |
|
|
106
|
+
| `Edit` | `replace_file_content`, `multi_replace_file_content` |
|
|
107
|
+
| `Glob` | `find_by_name` |
|
|
108
|
+
| `Grep` | `grep_search` |
|
|
109
|
+
| `WebSearch` | `search_web` |
|
|
110
|
+
| `WebFetch` | `read_url_content` |
|
|
111
|
+
| `Agent` | `invoke_subagent` |
|
|
112
|
+
| `AskUserQuestion` | `ask_question` |
|
|
113
|
+
|
|
114
|
+
- **Hook types**: `command` only (`type: "command"` is the sole supported type).
|
|
115
|
+
`async: true` handlers are NOT supported and produce a warning.
|
|
116
|
+
- **Native hooks schema** (Antigravity-native format):
|
|
117
|
+
```jsonc
|
|
118
|
+
{
|
|
119
|
+
"<hookName>": {
|
|
120
|
+
"enabled": true, // optional boolean
|
|
121
|
+
"PreInvocation": [ // direct events: handler array
|
|
122
|
+
{ "type": "command", "command": "...", "timeout": 30 }
|
|
123
|
+
],
|
|
124
|
+
"PreToolUse": [ // tool events: group array
|
|
125
|
+
{ "matcher": "run_command", "hooks": [
|
|
126
|
+
{ "type": "command", "command": "...", "timeout": 30 }
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
- **Environment bridging**: The generated `hook-runner.mjs` translates:
|
|
134
|
+
- `${CLAUDE_PLUGIN_ROOT}` / `${PLUGIN_ROOT}` → absolute plugin path
|
|
135
|
+
- Antigravity stdin JSON → Claude-format input fields
|
|
136
|
+
- Claude-format output → Antigravity decision output (`allow`/`deny`/`ask`/`stop`)
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 8. Environment Variables
|
|
141
|
+
|
|
142
|
+
| Variable | Description |
|
|
143
|
+
| :--- | :--- |
|
|
144
|
+
| `CLAUDE_PLUGIN_ROOT` | Set by hook-runner bridge to the absolute plugin directory. |
|
|
145
|
+
| `PLUGIN_ROOT` | Alias for `CLAUDE_PLUGIN_ROOT`. |
|
|
146
|
+
|
|
147
|
+
**Note**: These are injected by the generated `hook-runner.mjs`, not by the Antigravity
|
|
148
|
+
runtime itself. The runner bridges Claude-format command scripts to Antigravity's I/O.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Claude (Anthropic) — Adapter Specification
|
|
2
|
+
|
|
3
|
+
> Based on the [Agent Adapter Template](../agents-spec.md#7-agent-adapter-template).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Official References
|
|
8
|
+
|
|
9
|
+
- Plugin docs: <https://code.claude.com/docs/en/plugins-reference>
|
|
10
|
+
- Standard plugin layout: <https://code.claude.com/docs/en/plugins-reference#standard-plugin-layout>
|
|
11
|
+
- File locations reference: <https://code.claude.com/docs/en/plugins-reference#file-locations-reference>
|
|
12
|
+
- Manifest schema: <https://code.claude.com/docs/en/plugins-reference#plugin-manifest-schema>
|
|
13
|
+
- Hooks reference: <https://code.claude.com/docs/en/hooks>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Projection Output
|
|
18
|
+
|
|
19
|
+
- Output directory: `.claude-plugin/`
|
|
20
|
+
- Manifest file: `.claude-plugin/plugin.json`
|
|
21
|
+
- Adapter source: [`src/adapters/anthropic.ts`](../../src/adapters/anthropic.ts)
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 3. Manifest Schema
|
|
26
|
+
|
|
27
|
+
Required fields: `name`
|
|
28
|
+
|
|
29
|
+
Optional fields: `version`, `description`, `author`, `homepage`, `license`,
|
|
30
|
+
`category`, `skills`, `commands`, `agents`, `hooks`, `mcpServers`, `apps`,
|
|
31
|
+
`strict`, `displayName`, `repository`, `keywords`, `outputStyles`,
|
|
32
|
+
`lspServers`, `dependencies`, `userConfig`, `channels`,
|
|
33
|
+
`experimental.themes`, `experimental.monitors`
|
|
34
|
+
|
|
35
|
+
```jsonc
|
|
36
|
+
// Minimal projected manifest
|
|
37
|
+
{
|
|
38
|
+
"name": "my-plugin",
|
|
39
|
+
"version": "1.0.0",
|
|
40
|
+
"description": "Example plugin",
|
|
41
|
+
"skills": "./skills/"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 4. Supported Components
|
|
48
|
+
|
|
49
|
+
| Component | Supported | Manifest Key | Discovery Mechanism |
|
|
50
|
+
| :--- | :---: | :--- | :--- |
|
|
51
|
+
| Skills | ✅ | `skills` (string root or `./skills/<id>` path array) | Auto-scan `skills/` dir for sub-dirs with `SKILL.md`; or explicit path array |
|
|
52
|
+
| Agents | ✅ | `agents` | Markdown files in `agents/` dir |
|
|
53
|
+
| Commands | ✅ | `commands` | Markdown files in `commands/` dir |
|
|
54
|
+
| Hooks | ✅ | `hooks` | `hooks/hooks.json` (auto-loaded); explicit file path |
|
|
55
|
+
| MCP | ✅ | `mcpServers` | `.mcp.json` or inline in manifest |
|
|
56
|
+
| Apps | ✅ | `apps` | App directory |
|
|
57
|
+
| LSP | ✅ | `lspServers` | `.lsp.json` or inline (Claude-only, not in ADG) |
|
|
58
|
+
| Monitors | ✅ | `experimental.monitors` | `monitors/monitors.json` (Claude-only, not in ADG) |
|
|
59
|
+
| Themes | ✅ | `experimental.themes` | `themes/` dir (Claude-only, not in ADG) |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 5. Skills
|
|
64
|
+
|
|
65
|
+
- **Declared form**: String root (`"./skills/"`) or array of `./skills/<id>` paths.
|
|
66
|
+
- **Strict mode**: `strict: true` (default) = runtime discovers skills from directory.
|
|
67
|
+
`strict: false` = manifest enumerates all skills explicitly.
|
|
68
|
+
- **Array encoding**: Paths in `./skills/<name>` form (not bare ids).
|
|
69
|
+
- **Auto-discovery**: When `strict: true` and skills is a root string, Claude scans
|
|
70
|
+
the directory. A strict array is passed through verbatim.
|
|
71
|
+
- **Root SKILL.md**: A single `SKILL.md` at plugin root is loaded as a single-skill
|
|
72
|
+
plugin when no `skills/` dir exists and no `skills` key is declared.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 6. MCP Servers
|
|
77
|
+
|
|
78
|
+
- **Config file name**: `.mcp.json` (or inline in manifest under `mcpServers`)
|
|
79
|
+
- **Config key**: `mcpServers`
|
|
80
|
+
- **Special handling**: Supports `${CLAUDE_PLUGIN_ROOT}` substitution in command/args/env.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 7. Hooks
|
|
85
|
+
|
|
86
|
+
- **Canonical file**: `hooks/hooks.json` — **auto-loaded** by Claude runtime.
|
|
87
|
+
- **Native override**: N/A (Claude is the canonical format author).
|
|
88
|
+
- **Codex-specific override**: `hooks/hooks-codex.json` — different behavior per agent.
|
|
89
|
+
- **Supported events** (30 total):
|
|
90
|
+
`SessionStart`, `Setup`, `SessionEnd`, `UserPromptSubmit`, `UserPromptExpansion`,
|
|
91
|
+
`Stop`, `StopFailure`, `PreToolUse`, `PostToolUse`, `PostToolUseFailure`,
|
|
92
|
+
`PostToolBatch`, `PermissionRequest`, `PermissionDenied`, `SubagentStart`,
|
|
93
|
+
`SubagentStop`, `TeammateIdle`, `TaskCreated`, `TaskCompleted`,
|
|
94
|
+
`InstructionsLoaded`, `ConfigChange`, `FileChanged`, `CwdChanged`,
|
|
95
|
+
`WorktreeCreate`, `WorktreeRemove`, `PreCompact`, `PostCompact`,
|
|
96
|
+
`Elicitation`, `ElicitationResult`, `Notification`, `MessageDisplay`
|
|
97
|
+
- **Hook types**: `command`, `http`, `mcp_tool`, `prompt`, `agent`
|
|
98
|
+
- **Environment bridging**: `${CLAUDE_PLUGIN_ROOT}`, `${CLAUDE_PLUGIN_DATA}`,
|
|
99
|
+
`${CLAUDE_PROJECT_DIR}`, `${user_config.*}`.
|
|
100
|
+
- **ADG adapter note**: The standard `hooks/hooks.json` is auto-loaded by Claude.
|
|
101
|
+
The adapter MUST NOT repeat this path in the projected manifest, or Claude fails
|
|
102
|
+
with "Duplicate hooks file detected". Only _additional_ hook files are declared.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 8. Environment Variables
|
|
107
|
+
|
|
108
|
+
| Variable | Description |
|
|
109
|
+
| :--- | :--- |
|
|
110
|
+
| `${CLAUDE_PLUGIN_ROOT}` | Absolute path to the plugin installation directory. |
|
|
111
|
+
| `${CLAUDE_PLUGIN_DATA}` | Persistent data directory surviving updates. |
|
|
112
|
+
| `${CLAUDE_PROJECT_DIR}` | Current working directory of the project. |
|
|
113
|
+
| `${user_config.*}` | User-configured values from `userConfig` fields. |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Codex (OpenAI) — Adapter Specification
|
|
2
|
+
|
|
3
|
+
> Based on the [Agent Adapter Template](../agents-spec.md#7-agent-adapter-template).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Official References
|
|
8
|
+
|
|
9
|
+
- Plugin docs: <https://code.claude.com/docs/en/plugins-reference> (shared format with Claude)
|
|
10
|
+
- Codex shares Claude's plugin schema. Codex-specific behaviors are documented inline.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. Projection Output
|
|
15
|
+
|
|
16
|
+
- Output directory: `.codex-plugin/`
|
|
17
|
+
- Manifest file: `.codex-plugin/plugin.json`
|
|
18
|
+
- Adapter source: [`src/adapters/codex.ts`](../../src/adapters/codex.ts)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 3. Manifest Schema
|
|
23
|
+
|
|
24
|
+
Required fields: `name`, `version`, `description`, `skills`
|
|
25
|
+
|
|
26
|
+
Optional fields: `author`, `homepage`, `license`, `hooks`, `mcpServers`
|
|
27
|
+
|
|
28
|
+
```jsonc
|
|
29
|
+
// Minimal projected manifest
|
|
30
|
+
{
|
|
31
|
+
"name": "my-plugin",
|
|
32
|
+
"version": "1.0.0",
|
|
33
|
+
"description": "Example plugin",
|
|
34
|
+
"skills": "./skills/"
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 4. Supported Components
|
|
41
|
+
|
|
42
|
+
| Component | Supported | Manifest Key | Discovery Mechanism |
|
|
43
|
+
| :--- | :---: | :--- | :--- |
|
|
44
|
+
| Skills | ✅ | `skills` (string root or bare-id array) | Auto-scan `skills/` dir; or explicit bare-id array |
|
|
45
|
+
| Agents | ❌ | — | Not supported by Codex |
|
|
46
|
+
| Commands | ❌ | — | Not supported by Codex |
|
|
47
|
+
| Hooks | ✅ | `hooks` | Explicit file path (no auto-load) |
|
|
48
|
+
| MCP | ✅ | `mcpServers` | `.mcp.json` path reference |
|
|
49
|
+
| Apps | ❌ | — | Not supported by Codex |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 5. Skills
|
|
54
|
+
|
|
55
|
+
- **Declared form**: String root (`"./skills/"`) or array of **bare ids** (e.g. `["foo", "bar"]`).
|
|
56
|
+
- **Strict mode**: Same as Claude. `strict: true` passes root string through; Codex discovers from directory.
|
|
57
|
+
- **Array encoding**: **Bare ids** — NOT paths. This is the key difference from Claude.
|
|
58
|
+
ADG resolves `./skills/<id>` paths to bare ids during projection.
|
|
59
|
+
- **Auto-discovery**: Codex natively scans a directory root.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 6. MCP Servers
|
|
64
|
+
|
|
65
|
+
- **Config file name**: Same as Claude (`.mcp.json` reference).
|
|
66
|
+
- **Config key**: `mcpServers`
|
|
67
|
+
- **Special handling**: Accepts `${CLAUDE_PLUGIN_ROOT}` in configs.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 7. Hooks
|
|
72
|
+
|
|
73
|
+
- **Canonical file**: Not auto-loaded — requires explicit manifest reference.
|
|
74
|
+
- **Native override**: `hooks/hooks-codex.json` — preferred over `hooks/hooks.json`
|
|
75
|
+
when present. Adapter resolution order: `hooks-codex.json` → `hooks.json` → sole `*.json`.
|
|
76
|
+
- **Supported events** (10 total):
|
|
77
|
+
`SessionStart`, `SubagentStart`, `PreToolUse`, `PermissionRequest`,
|
|
78
|
+
`PostToolUse`, `PreCompact`, `PostCompact`, `UserPromptSubmit`,
|
|
79
|
+
`SubagentStop`, `Stop`
|
|
80
|
+
- **Hook types**: `command` (same as Claude)
|
|
81
|
+
- **Environment bridging**: Same as Claude (`${CLAUDE_PLUGIN_ROOT}`, etc.).
|
|
82
|
+
- **ADG adapter note**: Unlike Claude, Codex has no auto-load. The hooks config must
|
|
83
|
+
be a file path (not a directory). The adapter resolves `./hooks/` to a concrete file.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 8. Environment Variables
|
|
88
|
+
|
|
89
|
+
Same as Claude — `${CLAUDE_PLUGIN_ROOT}`, `${CLAUDE_PLUGIN_DATA}`, `${CLAUDE_PROJECT_DIR}`.
|
package/docs/agents-spec.md
CHANGED
|
@@ -130,3 +130,175 @@ a human or generated by an agent. Beyond JSON-schema validity it SHOULD enforce:
|
|
|
130
130
|
commit projections for a native registry.)
|
|
131
131
|
|
|
132
132
|
ADG reads the legacy `.adg-plugin/plugin.json` for one release to ease the move.
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## 6. Supported Agents — Plugin Paths
|
|
139
|
+
|
|
140
|
+
| Agent | Scope | Configuration / Plugin Paths | Details |
|
|
141
|
+
| :--- | :--- | :--- | :--- |
|
|
142
|
+
| **Claude** | Repo (Project) | `$REPO_ROOT/.claude/settings.json` | Team plugins shared via version control. |
|
|
143
|
+
| | Personal (Global) | `~/.claude/settings.json` | Personal plugins available across all projects (default). |
|
|
144
|
+
| **Codex** | Repo (Project) | Marketplace: `$REPO_ROOT/.agents/plugins/marketplace.json`<br>Plugins: `$REPO_ROOT/plugins/` | Add a marketplace file and store your workspace-specific plugins. |
|
|
145
|
+
| | Personal (Global) | Marketplace: `~/.agents/plugins/marketplace.json`<br>Plugins: `~/.codex/plugins/` | Add a marketplace file and store your global plugins. |
|
|
146
|
+
| **Antigravity** | Repo (Project) | `$REPO_ROOT/.agents/plugins/` | Place your plugin folder here; only available within this workspace. |
|
|
147
|
+
| | Personal (Global) | `~/.gemini/config/plugins/` | Place your plugin folder here; active across all workspaces. |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 7. Agent Adapter Template
|
|
152
|
+
|
|
153
|
+
Below is the **canonical template** every agent adapter MUST document. When adding
|
|
154
|
+
a new agent, copy this template and fill in the blanks. All existing agent sections
|
|
155
|
+
below follow this structure, making cross-agent comparison and adapter development
|
|
156
|
+
straightforward.
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
### <Agent Name>
|
|
160
|
+
|
|
161
|
+
#### 7.x.1 Official References
|
|
162
|
+
- Plugin docs: <URL>
|
|
163
|
+
- Manifest schema: <URL>
|
|
164
|
+
|
|
165
|
+
#### 7.x.2 Projection Output
|
|
166
|
+
- Output directory: <path relative to plugin root>
|
|
167
|
+
- Manifest file: <filename>
|
|
168
|
+
- Adapter source: `src/adapters/<file>.ts`
|
|
169
|
+
|
|
170
|
+
#### 7.x.3 Manifest Schema
|
|
171
|
+
- Required fields: ...
|
|
172
|
+
- Optional fields: ...
|
|
173
|
+
- Example (minimal):
|
|
174
|
+
|
|
175
|
+
#### 7.x.4 Supported Components
|
|
176
|
+
| Component | Supported | Manifest Key | Discovery Mechanism |
|
|
177
|
+
| :--- | :---: | :--- | :--- |
|
|
178
|
+
|
|
179
|
+
#### 7.x.5 Skills
|
|
180
|
+
- Declared form: ...
|
|
181
|
+
- Strict mode: ...
|
|
182
|
+
- Array encoding: ...
|
|
183
|
+
- Auto-discovery: ...
|
|
184
|
+
|
|
185
|
+
#### 7.x.6 MCP Servers
|
|
186
|
+
- Config file name: ...
|
|
187
|
+
- Config key: ...
|
|
188
|
+
- Special handling: ...
|
|
189
|
+
|
|
190
|
+
#### 7.x.7 Hooks
|
|
191
|
+
- Canonical file: ...
|
|
192
|
+
- Native override: ...
|
|
193
|
+
- Supported events: ...
|
|
194
|
+
- Event mapping: ...
|
|
195
|
+
- Hook types: ...
|
|
196
|
+
- Environment bridging: ...
|
|
197
|
+
|
|
198
|
+
#### 7.x.8 Environment Variables
|
|
199
|
+
- Plugin root: ...
|
|
200
|
+
- Substitution behavior: ...
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Each agent's full specification lives in its own file under `docs/agents/`:
|
|
204
|
+
|
|
205
|
+
| Agent | Spec File |
|
|
206
|
+
| :--- | :--- |
|
|
207
|
+
| Claude (Anthropic) | [`agents/claude.md`](./agents/claude.md) |
|
|
208
|
+
| Codex (OpenAI) | [`agents/codex.md`](./agents/codex.md) |
|
|
209
|
+
| Antigravity (Gemini) | [`agents/antigravity.md`](./agents/antigravity.md) |
|
|
210
|
+
|
|
211
|
+
When adding a new agent, create `docs/agents/<agent>.md` using the template above,
|
|
212
|
+
then add a row to this table.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 8. Cross-Agent Component Matrix
|
|
217
|
+
|
|
218
|
+
Summary of component support across all agents. This is the authoritative view for
|
|
219
|
+
deciding what an ADG plugin can expose to each runtime.
|
|
220
|
+
|
|
221
|
+
| Component | Claude | Codex | Antigravity | ADG Source Key |
|
|
222
|
+
| :--- | :---: | :---: | :---: | :--- |
|
|
223
|
+
| **Skills** | ✅ | ✅ | ✅ | `skills` |
|
|
224
|
+
| **Agents** | ✅ | ❌ | ✅ | `agents` |
|
|
225
|
+
| **Commands** | ✅ | ❌ | ✅ | `commands` |
|
|
226
|
+
| **Hooks** | ✅ | ✅ | ✅ | `hooks` |
|
|
227
|
+
| **MCP** | ✅ | ✅ | ✅ | `mcpServers` |
|
|
228
|
+
| **Apps** | ✅ | ❌ | ❌ | `apps` |
|
|
229
|
+
| **LSP** | ✅ | ❌ | ❌ | N/A (Claude-only) |
|
|
230
|
+
| **Monitors** | ✅ | ❌ | ❌ | N/A (Claude-only) |
|
|
231
|
+
| **Themes** | ✅ | ❌ | ❌ | N/A (Claude-only) |
|
|
232
|
+
|
|
233
|
+
Source: [`ADAPTER_COMPONENTS`](../src/adapters/index.ts) in `src/adapters/index.ts`.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 9. Cross-Agent Skills Encoding
|
|
238
|
+
|
|
239
|
+
Skills are the most universal component. Their manifest encoding differs per agent:
|
|
240
|
+
|
|
241
|
+
| Aspect | Claude | Codex | Antigravity |
|
|
242
|
+
| :--- | :--- | :--- | :--- |
|
|
243
|
+
| **Root string** | `"./skills/"` — passed through | `"./skills/"` — passed through | N/A — always auto-scans `skills/` |
|
|
244
|
+
| **Array form** | `["./skills/foo", "./skills/bar"]` (path form) | `["foo", "bar"]` (bare-id form) | N/A — no manifest array |
|
|
245
|
+
| **Strict default** | `true` — directory discovery | `true` — directory discovery | Always directory discovery |
|
|
246
|
+
| **Non-strict** | Explicit id list → `strict: false` | Explicit id list | N/A |
|
|
247
|
+
| **SKILL.md** | Required per skill sub-dir | Required per skill sub-dir | Required per skill sub-dir |
|
|
248
|
+
| **Frontmatter** | `name`, `description` (required) | `name`, `description` (required) | `name`, `description` (required) |
|
|
249
|
+
|
|
250
|
+
**Unified rule**: All agents discover skills as sub-directories of `skills/` containing
|
|
251
|
+
a `SKILL.md` with YAML frontmatter. The SKILL.md format is identical across all agents.
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## 10. Cross-Agent Hooks Comparison
|
|
256
|
+
|
|
257
|
+
Hooks require the most complex adapter logic. See also
|
|
258
|
+
[`docs/hooks-strategy.md`](./hooks-strategy.md) for the design rationale.
|
|
259
|
+
|
|
260
|
+
| Aspect | Claude | Codex | Antigravity |
|
|
261
|
+
| :--- | :--- | :--- | :--- |
|
|
262
|
+
| **Canonical format** | Claude's format is canonical | Same as Claude | Native schema (different) |
|
|
263
|
+
| **Authoring file** | `hooks/hooks.json` | `hooks/hooks.json` or `hooks/hooks-codex.json` | `hooks/hooks-antigravity.json` or translated from canonical |
|
|
264
|
+
| **Discovery** | Auto-loaded from `hooks/hooks.json` | Explicit manifest reference (no auto-load) | Root `hooks.json` at plugin root |
|
|
265
|
+
| **Supported events** | 30 events | 10 events | 4 events |
|
|
266
|
+
| **Hook types** | `command`, `http`, `mcp_tool`, `prompt`, `agent` | `command` | `command` |
|
|
267
|
+
| **Matcher** | Regex string | Regex string | Simple tool-name alternation |
|
|
268
|
+
| **Translation by ADG** | None (canonical) | Minimal (file resolution) | Full (schema + event + tool-name + I/O bridge) |
|
|
269
|
+
|
|
270
|
+
### Hooks authoring strategy
|
|
271
|
+
|
|
272
|
+
| Scenario | What to do |
|
|
273
|
+
| :--- | :--- |
|
|
274
|
+
| Same behavior across all agents | Author one `hooks/hooks.json` in Claude's format. ADG routes and translates. |
|
|
275
|
+
| Different behavior per agent | Ship native override files: `hooks/hooks-codex.json`, `hooks/hooks-antigravity.json`. ADG routes each to the right target. |
|
|
276
|
+
| Antigravity-only behavior | Author `hooks/hooks-antigravity.json` in Antigravity's native schema. Bypasses translation. |
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 11. Cross-Agent MCP Comparison
|
|
281
|
+
|
|
282
|
+
| Aspect | Claude | Codex | Antigravity |
|
|
283
|
+
| :--- | :--- | :--- | :--- |
|
|
284
|
+
| **Config file** | `.mcp.json` or inline in manifest | `.mcp.json` reference | `mcp_config.json` at plugin root |
|
|
285
|
+
| **Manifest key** | `mcpServers` | `mcpServers` | N/A (discovered by file presence) |
|
|
286
|
+
| **Format** | `{ "mcpServers": { "<name>": { "command": ... } } }` | Same as Claude | Same as Claude |
|
|
287
|
+
| **Projection** | Passed through | Passed through | Copied from source `.mcp.json` to `mcp_config.json` |
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 12. Adding a New Agent
|
|
292
|
+
|
|
293
|
+
When support for a new agent runtime is needed:
|
|
294
|
+
|
|
295
|
+
1. **Create adapter source** at `src/adapters/<agent>.ts` implementing `AdapterFn`.
|
|
296
|
+
2. **Register** in [`src/adapters/index.ts`](../src/adapters/index.ts):
|
|
297
|
+
- Add to `ADAPTERS` map with agent name and any aliases.
|
|
298
|
+
- Add to `ADAPTER_TARGETS`.
|
|
299
|
+
- Add to `ADAPTER_COMPONENTS` with the supported component types.
|
|
300
|
+
3. **Document** by copying the template in §7 and filling in all sections.
|
|
301
|
+
4. **Update cross-agent matrices** (§8–§11) to include the new agent column.
|
|
302
|
+
5. **Add hook event support** in [`src/hooks.ts`](../src/hooks.ts) `SUPPORTED_EVENTS`.
|
|
303
|
+
6. **Test** via `adg plugins adapt --target <agent>` and `adg plugins validate`.
|
|
304
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rbbtsn0w/adg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.1",
|
|
4
4
|
"description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
"comment:dependencies": "Runtime deps below are required only by the vendored skills CLI (vendor/skills); ADG's own plugins code has zero runtime deps. Root is the single source of truth: each range MUST be >= the floor declared in vendor/skills/package.json, since that is the version the vendored source was authored against. `npm run check:vendor-deps` enforces this and fails on drift.",
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@clack/prompts": "^0.11.0",
|
|
43
|
+
"@opentelemetry/api": "^1.9.0",
|
|
44
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
|
|
45
|
+
"@opentelemetry/resources": "^2.8.0",
|
|
46
|
+
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
47
|
+
"@opentelemetry/sdk-trace-node": "^2.8.0",
|
|
48
|
+
"@opentelemetry/semantic-conventions": "^1.28.0",
|
|
43
49
|
"@vercel/detect-agent": "^1.2.3",
|
|
44
50
|
"picocolors": "^1.1.1",
|
|
45
51
|
"simple-git": "^3.36.0",
|
|
@@ -49,12 +49,13 @@ re-vendoring. Each is marked inline with an `ADG patch:` comment.
|
|
|
49
49
|
| `src/blob.ts` → `fetchRepoTree` / `fetchTreeBranch` (+ `authMayHelp` on `BranchFetchResult`) | Retry authenticated on 401/403/404, not only on a rate-limit 403 | **Private-repo bug**: GitHub returns 404 to anonymous tree requests for private repos. Upstream only fell back to a token on rate limit, so private skills sources never used the token and always "failed to fetch tree". |
|
|
50
50
|
| `src/skill-lock.ts` → `getGitHubToken` warning text | "GitHub rate limit reached" → "GitHub authentication needed" | The resolver is now also used to reach private repos, not just to recover from a rate limit. |
|
|
51
51
|
| `src/update.ts` → `updateGlobalSkills` | Track `failedSources`; stop printing "All global skills are up to date" when a source could not be checked | The swallowed private-repo failure used to be masked by a false "up to date". Now surfaced, with a hint to set `GITHUB_TOKEN` / `gh auth login`, and counted in `failCount`. |
|
|
52
|
-
| `src/update.ts` → `SELF_CLI_ENTRY` (both global + project update paths) | Re-invoke
|
|
52
|
+
| `src/update.ts` → `SELF_CLI_ENTRY` (both global + project update paths) | Re-invoke ADG binary `bin/adg.ts` / `bin/adg.js` instead of `cli.ts` / `cli.js` | Unifies execution under the main ADG product logic (`adg skills add`), keeping telemetry and wrapper context active. |
|
|
53
|
+
| `src/telemetry.ts` → `getTracer` | SERVICE_NAME `"adg-skills"` $\rightarrow$ `"adg"`, plus `domain: "skills"` span attribute and export `getTracer` | Unifies the telemetry tracking under the single complete `adg` product service name while keeping domain categorization, and allows `update.ts` to wrap subprocesses in CLIENT spans. |
|
|
53
54
|
| `src/git.ts` → `createGitClient` | Add `unsafe: { allowUnsafeFilter: true }` to `simpleGit(...)` | simple-git ≥3.36 blocks `filter.*.smudge/clean` configs (RCE vector) and fails **every** clone with "Configuring filter.smudge is not permitted without enabling allowUnsafeFilter". The configs here set the LFS filter to EMPTY (disabling it), so opting in is safe and matches their intent. |
|
|
54
55
|
| `src/git.ts` → `import simpleGit from 'simple-git'` | Default → named import `import { simpleGit } from 'simple-git'` | The default import is not callable under ADG's strict root tsconfig (NodeNext + verbatimModuleSyntax, no esModuleInterop); the named export is. Needed for `git.ts` to typecheck when a test imports it (e.g. via `use.ts`). |
|
|
55
56
|
| `src/git.ts` → `createGitClient` env | Pass env via `.env({...})` instead of as a `simpleGit(...)` constructor option | **Latent runtime bug**: simple-git's factory only reads `baseDir`/`maxConcurrentProcesses`/`config`/`trimmed`/plugins from the options object and silently drops `env`, so `GIT_TERMINAL_PROMPT`/`GIT_LFS_SKIP_SMUDGE`/`GIT_SSH_COMMAND` never reached the spawned git (it inherited the full parent env). `.env(object)` is the documented API and sets the executor env actually used at spawn. |
|
|
56
57
|
| `src/skills.ts` → `parseSkillMd` | Narrow `data.metadata` (frontmatter `unknown`) to `Record<string, unknown> \| undefined` before reading `.internal` / returning it | Behavior-preserving type fix so `skills.ts` typechecks under ADG's strict root tsconfig when reached via `use.ts`/tests. |
|
|
57
|
-
| `src/update.ts` → both `spawnSync` self-CLI re-invokes (+ new `src/self-cli.ts`) | Forward `process.execArgv`
|
|
58
|
+
| `src/update.ts` → both `spawnSync` self-CLI re-invokes (+ new `src/self-cli.ts`) | Forward `process.execArgv`, call `skills add` instead of `add`, and wrap in OpenTelemetry CLIENT spans | The child process runs `adg skills add` inside the spawned Node context, ensuring type-stripping flags inherit properly, and OTel spans capture subprocess execution metadata. |
|
|
58
59
|
| `package.json` → `@vercel/detect-agent` dependency (not a vendored-source change) | `^0.1.0` → `^1.2.3` | `src/detect-agent.ts` (upstream, unpatched) imports `AgentResult` and expects `determineAgent(): Promise<AgentResult>` (object API). The stale `0.1.0` pin only exported `determineAgent(): Promise<string \| false>` and no `AgentResult`, which broke typecheck and left `cachedResult.isAgent` always `undefined` at runtime — agent auto-detection (non-interactive mode in `add`/`sync`/`remove`/`find`/`cli`) silently never fired. The `1.x` line restores the API the fork targets, so `detect-agent.ts` needs **no** local patch. Keep this dependency on `1.x` across re-vendoring. |
|
|
59
60
|
| `src/git-tree.ts` (**new ADG file**) + `src/add.ts` clone-fallback branch | github source that falls back to a `git clone` now records the git **tree SHA** (`git rev-parse HEAD:<folder>`), not a sha256 content hash | Install and update must use ONE hash scheme per source. Update-check always uses the git tree SHA; the old clone fallback stored a sha256 content hash, so those skills were re-flagged on **every** update (a collection repo appeared to "fully update" each run). `git-tree.ts` is standalone (uses `child_process`, no simple-git) so it typechecks under ADG's strict tsconfig when a test imports it. |
|
|
60
61
|
| `src/update.ts` → `updateGlobalSkills` self-heal | A github entry whose stored hash isn't a 40-hex tree SHA (legacy clone-fallback) is normalized to the current tree SHA and NOT flagged; lock rewritten once | Heals locks written before the fix above without a version bump / lock wipe, and stops the perpetual false "update". |
|