@softspark/ai-toolkit 4.14.0 → 4.15.0

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 (48) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +11 -10
  3. package/app/.claude-plugin/plugin.json +1 -1
  4. package/app/CLAUDE.md.template +3 -0
  5. package/app/agents/fact-checker.md +1 -1
  6. package/app/hooks/_search-capability.sh +3 -2
  7. package/app/hooks/stop-search-check.sh +2 -1
  8. package/benchmarks/ecosystem-doctor-snapshot.json +73 -31
  9. package/kb/procedures/maintenance-sop.md +26 -13
  10. package/kb/procedures/release-verification-sop.md +41 -36
  11. package/kb/reference/architecture-overview.md +23 -7
  12. package/kb/reference/codex-cli-compatibility.md +96 -36
  13. package/kb/reference/extension-api.md +52 -9
  14. package/kb/reference/global-install-model.md +53 -21
  15. package/kb/reference/hooks-catalog.md +44 -8
  16. package/kb/reference/mcp-editor-compatibility.md +27 -6
  17. package/kb/reference/mcp-templates.md +12 -6
  18. package/kb/reference/opencode-compatibility.md +13 -7
  19. package/kb/reference/plugin-pack-conventions.md +7 -7
  20. package/kb/reference/skills-catalog.md +3 -3
  21. package/kb/reference/supported-tools-registry.md +19 -17
  22. package/kb/reference/windows-support.md +26 -3
  23. package/llms-full.txt +443 -180
  24. package/llms.txt +1 -1
  25. package/manifest.json +1 -1
  26. package/package.json +2 -2
  27. package/scripts/codex_skill_adapter.py +448 -198
  28. package/scripts/dir_rules_shared.py +2 -11
  29. package/scripts/ecosystem_tools.json +29 -8
  30. package/scripts/emission.py +5 -91
  31. package/scripts/generate_agents_md.py +4 -87
  32. package/scripts/generate_codex.py +5 -95
  33. package/scripts/generate_codex_agents.py +242 -0
  34. package/scripts/generate_codex_hooks.py +648 -55
  35. package/scripts/generate_codex_skills.py +15 -6
  36. package/scripts/generate_copilot.py +771 -74
  37. package/scripts/generate_copilot_hooks.py +606 -0
  38. package/scripts/generate_cursor_hooks.py +453 -121
  39. package/scripts/generate_opencode_commands.py +4 -6
  40. package/scripts/inject_hook_cli.py +770 -205
  41. package/scripts/injection.py +102 -23
  42. package/scripts/install_steps/ai_tools.py +123 -83
  43. package/scripts/instruction_core.py +95 -0
  44. package/scripts/mcp_editors.py +934 -80
  45. package/scripts/mcp_manager.py +46 -26
  46. package/scripts/plugin.py +291 -114
  47. package/scripts/secure_fs.py +538 -0
  48. package/scripts/uninstall.py +1279 -208
@@ -3,9 +3,9 @@ title: "Global Install Model"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [install, global, claude, codex, plugins, local-setup]
6
- version: "3.2.0"
6
+ version: "3.3.0"
7
7
  created: "2026-03-26"
8
- last_updated: "2026-07-10"
8
+ last_updated: "2026-07-14"
9
9
  description: "Reference description of Claude Code global install, Claude app plugin export, project-local editor setup, global Codex plugin layering, and command responsibilities in ai-toolkit."
10
10
  ---
11
11
 
@@ -19,10 +19,11 @@ That means one machine-level install provides agents, skills, hooks, constitutio
19
19
 
20
20
  Other editor targets are opt-in and only use documented file surfaces. Cursor
21
21
  rules stay project-local because Cursor's global user rules are managed through
22
- the settings UI, not a stable merge-safe file. Codex remains project-local for
23
- the core toolkit install, but experimental plugin packs can layer a global
24
- Codex target in `HOME` when explicitly installed with
25
- `ai-toolkit plugin install --editor codex`.
22
+ the settings UI, not a stable merge-safe file. Codex supports both project and
23
+ user installs: project files stay in the repository, while user files use the
24
+ active `CODEX_HOME` (default `~/.codex`) and shared user skills use
25
+ `$HOME/.agents/skills/`. Experimental plugin packs can add a layer to the same
26
+ Codex user surface.
26
27
 
27
28
  Claude Chat/Desktop/Cowork is a separate runtime. It does not read the
28
29
  filesystem surfaces under `~/.claude`; it receives ai-toolkit through an
@@ -53,12 +54,14 @@ The `--profile` flag controls how much of each editor's native surface is activa
53
54
 
54
55
  | Profile | What runs | Use when |
55
56
  |---------|-----------|----------|
56
- | `minimal` | Agents and skills only. No editor generators beyond pointer skills for editors that require them. | You want the smallest possible footprint, or you manage editor configs by hand. |
57
- | `standard` (default) | Claude Code + editor rule files. Includes **Gemini hooks** and the **Copilot directory layout** (v3.0.0 change from prior `standard`). | Day-to-day installs. Most users. |
57
+ | `minimal` | Smallest editor surface. Copilot still receives its root instructions, native agents, and self-contained skills; Codex still receives instructions, agents, skills, and native safety hooks. | You want the smallest supported footprint. |
58
+ | `standard` (default) | Claude Code + editor rule files. Includes Gemini hooks and native Copilot instructions, agents, portable skills, and hooks. | Day-to-day installs. Most users. |
58
59
  | `strict` | Everything in `standard` plus git-hook wiring for commit-time safety checks. | Solo dev or tight team with zero tolerance for drift. |
59
60
  | `full` | Every native surface across every editor: hooks, sub-agents, custom commands, skill pointers for Cursor / Windsurf / Gemini / Augment / Antigravity. | You want maximum coverage and understand that each editor will carry generated files under its own layout. |
60
61
 
61
- `--codex-skills` is an independent opt-in flag (not part of profile) that materializes the full skill catalog under `.agents/skills/` for Codex. Other editors stay on compat-read or the per-editor pointer skill.
62
+ Codex installs materialize the full skill catalog under `.agents/skills/`
63
+ regardless of profile. The legacy `--codex-skills` flag only requests an
64
+ explicit second refresh of that same mirror and is no longer required.
62
65
 
63
66
  ## Global Editor Targets
64
67
 
@@ -100,14 +103,14 @@ with documented, file-based config surfaces:
100
103
  - `cline`: `~/Documents/Cline/Rules/ai-toolkit-*.md` plus `~/.cline/skills/ai-toolkit-skill-catalogue/SKILL.md`
101
104
  - `roo`: `~/.roo/rules/ai-toolkit-*.md` plus `~/.agents/skills/*` (Roo/Zoo native skill discovery; skipped when `codex` is also selected, which fills the same dir)
102
105
  - `aider`: `~/.aider.conf.yml` plus `~/.aider-ai-toolkit-CONVENTIONS.md` when the YAML file does not already exist
103
- - `codex`: `~/.codex/AGENTS.md` (coding rules inlined; the documented global instruction file NOT `~/AGENTS.md`, which Codex never loads as global instructions), `~/.agents/skills/*`, `~/.codex/hooks.json`
106
+ - `codex`: `$CODEX_HOME/AGENTS.md`, `$CODEX_HOME/agents/*.toml`, `$CODEX_HOME/hooks.json`, `$CODEX_HOME/ai-toolkit-hooks/*`, plus `$HOME/.agents/skills/*`; `CODEX_HOME` defaults to `~/.codex`, and `~/AGENTS.md` is not Codex's user-instruction file
104
107
  - `opencode`: `~/.config/opencode/*`
105
108
 
106
109
  Cursor, GitHub Copilot, and Google Antigravity now have partial global support,
107
110
  scoped to whatever documented HOME file surface each exposes:
108
111
 
109
112
  - `cursor`: `~/.cursor/hooks.json` (safety/quality hooks; profile ≥ standard). Cursor RULES stay project-local — their only global surface is the Settings UI.
110
- - `copilot`: `~/.copilot/copilot-instructions.md` plus `~/.copilot/instructions/ai-toolkit-*.instructions.md` (read by Copilot CLI; VS Code and GitHub.com still use repo `.github/` files, which the local install emits).
113
+ - `copilot`: instructions, native agents, portable skills, and native hooks under `$COPILOT_HOME` when set or `~/.copilot` otherwise. The hook config is `hooks/ai-toolkit.json`; its self-contained runtime is `hooks/ai-toolkit/copilot_hook.py`. VS Code and GitHub.com still use repo `.github/` files, which local install emits.
111
114
  - `antigravity`: skill pointer at `~/.gemini/config/skills/` and `~/.gemini/antigravity-cli/skills/`. Antigravity RULES stay project-local.
112
115
 
113
116
  Their global MCP support, where available, is handled by `ai-toolkit mcp
@@ -134,7 +137,15 @@ These files still stay local to a repository as part of the core install model:
134
137
  - project `.agents/rules/*.md`
135
138
  - project `.agents/skills/*`
136
139
  - project `.codex/hooks.json`
140
+ - project `.codex/hooks/*`
141
+ - project `.codex/agents/*.toml`
142
+ - project `.codex/config.toml` when Codex MCP servers are selected
137
143
  - `.github/copilot-instructions.md`
144
+ - `.github/instructions/ai-toolkit-*.instructions.md`
145
+ - `.github/prompts/ai-toolkit-*.prompt.md`
146
+ - `.github/agents/ai-toolkit-*.agent.md`
147
+ - `.github/skills/ai-toolkit-*/SKILL.md` plus required assets and helper scripts
148
+ - `.github/hooks/ai-toolkit.json` plus `.github/hooks/ai-toolkit/copilot_hook.py` (profile ≥ `standard`)
138
149
  - `.clinerules`
139
150
  - `.roomodes`
140
151
  - `.aider.conf.yml`
@@ -145,20 +156,39 @@ These files still stay local to a repository as part of the core install model:
145
156
 
146
157
  Project-local Claude Code language rules live in `.claude/rules/ai-toolkit-*.md` with `paths` frontmatter. They are separate from the global user-level `~/.claude/rules/ai-toolkit-*.md` files above.
147
158
 
148
- Hooks do **not** live in project-local settings. They are merged only into global `~/.claude/settings.json`.
159
+ Claude Code hooks do **not** live in project-local settings. They are merged only into global `~/.claude/settings.json`. Editor-native generators may emit project-local hook files when that editor documents them; Copilot uses `.github/hooks/*.json` and Codex uses `.codex/hooks.json`.
149
160
 
150
- Codex is the exception in terms of file location, not hook ownership: its local
151
- `.codex/hooks.json` points to hook scripts already installed globally in
152
- `~/.softspark/ai-toolkit/hooks/`.
161
+ ## Copilot Install Behavior
162
+
163
+ `ai-toolkit install --local --editors copilot` always emits root `AGENTS.md`,
164
+ `.github/copilot-instructions.md`, native `.github/agents`, and portable,
165
+ self-contained `.github/skills`. Profiles `standard`, `strict`, and `full`
166
+ add scoped `.github/instructions`, `.github/prompts`, and native version-1
167
+ `.github/hooks`. Profile `minimal` omits those three additional directories.
168
+
169
+ Global install emits personal instructions, scoped instructions, agents, and
170
+ skills under the active Copilot config root; profile `standard` and above adds
171
+ hooks. Personal prompt files are not a documented Copilot CLI user surface and
172
+ are not generated. `COPILOT_HOME` replaces `~/.copilot` for every generated
173
+ Copilot surface, including `mcp-config.json`. Existing user files and user-added
174
+ skill assets are preserved; reserved managed-path collisions and symlinked
175
+ config roots are rejected instead of overwritten.
176
+
177
+ Codex hook bundles are self-contained. Project `.codex/hooks.json` commands
178
+ reference executable assets in `.codex/hooks/`; user `$CODEX_HOME/hooks.json`
179
+ commands reference `$CODEX_HOME/ai-toolkit-hooks/`. Neither bundle depends on
180
+ Claude's shared `~/.softspark/ai-toolkit/hooks/` installation.
153
181
 
154
182
  ## Codex Local Install Behavior
155
183
 
156
184
  `ai-toolkit install --local --editors codex` creates:
157
185
 
158
186
  - `AGENTS.md`
159
- - `.agents/rules/*.md`
160
187
  - `.agents/skills/*`
161
188
  - `.codex/hooks.json`
189
+ - `.codex/hooks/*`
190
+ - `.codex/agents/*.toml`
191
+ - `.codex/config.toml` when project MCP servers are selected
162
192
 
163
193
  Native Codex-compatible skills are linked directly. Claude-oriented skills that
164
194
  depend on `Agent`, `Team*`, or `Task*` primitives are translated into generated
@@ -168,12 +198,13 @@ Codex wrappers so the project still receives the full skill catalog.
168
198
 
169
199
  `ai-toolkit plugin install --editor codex <pack>` additionally targets:
170
200
 
171
- - `~/.codex/AGENTS.md` (base instructions; pack rules are marker-injected here, not written as unread `~/.agents/rules/` files)
172
- - `~/.agents/skills/*`
173
- - `~/.codex/hooks.json`
201
+ - `$CODEX_HOME/AGENTS.md` (pack rules are marker-injected here)
202
+ - `$HOME/.agents/skills/*`
203
+ - `$CODEX_HOME/hooks.json`
204
+ - `$CODEX_HOME/ai-toolkit-hooks/plugin-<pack>-*`
174
205
 
175
- This is not the default core install path. It is an explicit, opt-in plugin
176
- layer used only for plugin packs. Runtime state is tracked in
206
+ This is an explicit, opt-in layer on top of the normal Codex user install.
207
+ Runtime state is tracked in
177
208
  `~/.softspark/ai-toolkit/plugins.json` per target (`claude`, `codex`).
178
209
 
179
210
  ## MCP Local Sync Behavior
@@ -183,6 +214,7 @@ If `.mcp.json` exists in the current project, `ai-toolkit install --local` mirro
183
214
  - `.cursor/mcp.json` when `--editors cursor` is selected
184
215
  - `.github/mcp.json` when `--editors copilot` is selected
185
216
  - `.roo/mcp.json` when `--editors roo` is selected
217
+ - `.codex/config.toml` when `--editors codex` is selected
186
218
 
187
219
  Global-only editor MCP configs are not written during `install --local`. Use `ai-toolkit mcp install --editor <name...>` for those targets.
188
220
 
@@ -3,9 +3,9 @@ title: "Hooks Catalog"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [hooks, quality, safety, enforcement, settings.json]
6
- version: "1.6.0"
6
+ version: "1.7.0"
7
7
  created: "2026-03-27"
8
- last_updated: "2026-06-10"
8
+ last_updated: "2026-07-14"
9
9
  description: "Complete reference of all ai-toolkit hooks: events, scripts, installation, and runtime behavior."
10
10
  ---
11
11
 
@@ -426,7 +426,7 @@ First-match-wins per file. Built-in runners: `bats`, `pytest`, `vitest`, `jest`.
426
426
  | Script | `~/.softspark/ai-toolkit/hooks/search-tracker.sh` |
427
427
  | Fires | After any search-style tool call |
428
428
 
429
- **Action:** Clears `~/.softspark/ai-toolkit/state/search-required-<session_id>.flag` (per-session, keyed by `session_id` from the hook stdin payload, falling back to `transcript_path` basename, then `default`). Pairs with `user-prompt-submit.sh` (sets the flag on long technical prompts only when a search provider is detected or strict mode is enabled) and `stop-search-check.sh` (blocks Stop if the calling session's flag is still set). Search provider detection parses actual MCP server names from `mcpServers`, `mcp_servers`, or `mcp` config blocks; hook matchers and permission allowlists do not count as providers. Codex Stop enforcement also scans the recent `~/.codex/log/codex-tui.log` window for `ToolCall: mcp__...__smart_query` and `tool.name="smart_query"`-style entries because Codex MCP tool calls may not fire the shared `PostToolUse` tracker. Together the hooks enforce the global CLAUDE.md GOLDEN RULE without breaking offline/no-RAG installs and without cross-session interference when multiple Claude Code windows run in parallel.
429
+ **Action:** Clears `~/.softspark/ai-toolkit/state/search-required-<session_id>.flag` (per-session, keyed by `session_id` from the hook stdin payload, falling back to `transcript_path` basename, then `default`). Pairs with `user-prompt-submit.sh` (sets the flag on long technical prompts only when a search provider is detected or strict mode is enabled) and `stop-search-check.sh` (blocks Stop if the calling session's flag is still set). Search provider detection parses actual MCP server names from `mcpServers`, `mcp_servers`, or `mcp` config blocks; hook matchers and permission allowlists do not count as providers. Codex Stop enforcement also scans the recent `$CODEX_HOME/log/codex-tui.log` window (default `~/.codex/log/codex-tui.log`) for `ToolCall: mcp__...__smart_query` and `tool.name="smart_query"`-style entries because Codex MCP tool calls may not fire the shared `PostToolUse` tracker. Together the hooks enforce the global CLAUDE.md GOLDEN RULE without breaking offline/no-RAG installs and without cross-session interference when multiple Claude Code windows run in parallel.
430
430
 
431
431
  Non-blocking (exit 0). Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
432
432
 
@@ -439,7 +439,7 @@ Non-blocking (exit 0). Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
439
439
  | Script | `~/.softspark/ai-toolkit/hooks/stop-search-check.sh` |
440
440
  | Fires | When Claude finishes a response |
441
441
 
442
- **Action:** If `search-required-<session_id>.flag` for the calling session is still present (no search tool ran during this turn) and a search provider is still detectable, emits `{"decision":"block","reason":"..."}` to continue the conversation with a search-first reminder. If no RAG/Web provider is detected, it clears the stale flag and exits 0, so offline/no-MCP users are not blocked. On Codex, where MCP search tools may not trigger the shared `PostToolUse` tracker, the hook also checks `~/.codex/log/codex-tui.log` for search tool calls after the flag timestamp before blocking. Flags are scoped by `session_id` from the hook stdin payload so a Stop in session B never consumes session A's flag (and vice versa). Stale per-session flags older than 60 minutes are GC'd on the next `SessionStart`.
442
+ **Action:** If `search-required-<session_id>.flag` for the calling session is still present (no search tool ran during this turn) and a search provider is still detectable, emits `{"decision":"block","reason":"..."}` to continue the conversation with a search-first reminder. If no RAG/Web provider is detected, it clears the stale flag and exits 0, so offline/no-MCP users are not blocked. On Codex, where MCP search tools may not trigger the shared `PostToolUse` tracker, the hook also checks `$CODEX_HOME/log/codex-tui.log` (default `~/.codex/log/codex-tui.log`) for search tool calls after the flag timestamp before blocking. Flags are scoped by `session_id` from the hook stdin payload so a Stop in session B never consumes session A's flag (and vice versa). Stale per-session flags older than 60 minutes are GC'd on the next `SessionStart`.
443
443
 
444
444
  **Overrides:** `CLAUDE_SKIP_SEARCH_FIRST=1`, `AI_TOOLKIT_SEARCH_FIRST=off`, or `AI_TOOLKIT_SEARCH_FIRST=strict` to force enforcement. Skipped when `TOOLKIT_HOOK_PROFILE=minimal`.
445
445
 
@@ -562,15 +562,15 @@ commands explicitly silent, and Codex-generated hooks plus Claude's bundled
562
562
  └── ConfigChange → config-desync-guard.sh
563
563
  ```
564
564
 
565
- **Key design decisions:**
565
+ **Claude Code design decisions:**
566
566
  - Scripts **copied** (not symlinked) — user can customize without breaking git
567
567
  - Hooks in `settings.json` (not `hooks.json`) — Claude Code only reads settings files
568
568
  - `_source: "ai-toolkit"` tag on every entry — allows idempotent merge/strip
569
- - Hooks are **global only** — `--local` does not install hooks into project settings
569
+ - Claude hooks are **global only** — `--local` does not install them into project settings
570
570
 
571
- ## Per-Editor Native Hooks (profile=full)
571
+ ## Per-Editor Native Hooks
572
572
 
573
- Beyond the global Claude Code hooks above, full-profile project installs emit native hook files for editors that support their own hook lifecycle. All reuse the same `~/.softspark/ai-toolkit/hooks/*.sh` scripts and the `_source: ai-toolkit` merge tag.
573
+ Beyond the global Claude Code hooks above, editor profiles emit native hook files for runtimes that support their own lifecycle. The profile threshold and command/output contract are editor-specific; generators must not assume Claude event names or exit semantics.
574
574
 
575
575
  | Editor | File | Generator | Format |
576
576
  |--------|------|-----------|--------|
@@ -578,6 +578,42 @@ Beyond the global Claude Code hooks above, full-profile project installs emit na
578
578
  | Devin CLI | `.devin/hooks.v1.json` | `generate_devin_hooks.py` | Claude-compatible (the replacement for Cascade) |
579
579
  | Gemini CLI | `.gemini/settings.json` (hooks block) | `generate_gemini_hooks.py` | Gemini `BeforeTool`/`AfterTool` events |
580
580
  | Augment | `.augment/settings.json` (hooks block) | `generate_augment_hooks.py` | Claude-style events |
581
+ | GitHub Copilot | `.github/hooks/ai-toolkit.json`; user `$COPILOT_HOME/hooks/ai-toolkit.json` | `generate_copilot_hooks.py` | GitHub version 1, camelCase events (profile ≥ `standard`) |
582
+ | Codex CLI | `.codex/hooks.json`; user `$CODEX_HOME/hooks.json` | `generate_codex_hooks.py` | Native Codex schema, PascalCase events, command ownership markers |
583
+
584
+ ### Cursor hooks (`.cursor/hooks.json`)
585
+
586
+ Cursor hooks follow the native [version-1 hooks contract](https://cursor.com/docs/hooks):
587
+
588
+ - **Cloud:** cloud agents load only repository `.cursor/hooks.json`; they cannot read user-level `~/.cursor/hooks.json`. Project commands call the adjacent self-contained `.cursor/hooks/ai-toolkit/cursor_hook.py` runtime and contain no host `~/.softspark` dependency.
589
+ - **Events:** the generator emits the complete documented Agent, Tab, and workspace lifecycle event set, including Cursor 3.11 conversation events `beforeSubmitPrompt`, `afterAgentResponse`, `afterAgentThought`, `subagentStart`, `subagentStop`, `preCompact`, and `stop`.
590
+ - **Schema:** managed entries use only documented `command`, `timeout`, and `loop_limit` fields. Regeneration recognizes the runtime command as its ownership marker and removes legacy `_source: ai-toolkit` entries without emitting that non-standard key again.
591
+ - **Safety:** destructive shell commands return Cursor's native `permission: deny` response and exit 2. A failed detected quality gate returns a bounded `followup_message`; `stop` and `subagentStop` declare `loop_limit: 5`, with an earlier three-failure circuit breaker in the runtime.
592
+ - **Preservation:** unrelated top-level settings and user hook entries survive regeneration. Config and runtime replacement is staged and rejects symlinked destinations or a user-owned runtime collision.
593
+
594
+ ### GitHub Copilot hooks (`.github/hooks/ai-toolkit.json`)
595
+
596
+ Copilot hooks follow GitHub's native [hooks reference](https://docs.github.com/en/copilot/reference/hooks-reference), not Claude's settings schema:
597
+
598
+ - **Locations:** repository hooks live in `.github/hooks/*.json`; user hooks live in `hooks/*.json` below `$COPILOT_HOME` or `~/.copilot`.
599
+ - **File shape:** top-level `version: 1` plus a `hooks` object containing camelCase events.
600
+ - **Runtime:** `ai-toolkit.json` calls the adjacent self-contained `ai-toolkit/copilot_hook.py`; local hooks do not depend on a package checkout or `~/.softspark` scripts.
601
+ - **Native decisions:** `preToolUse` returns `permissionDecision`, `permissionDecisionReason`, and optional `modifiedArgs`. `agentStop` returns `decision` plus `reason`. Context events use `additionalContext`.
602
+ - **Failure semantics:** the runtime uses GitHub's event-specific stdout and exit-code contracts. It does not reuse Claude's generic exit-2 blocking behavior.
603
+ - **Loop safety:** a failing `agentStop` quality gate can block twice; the third consecutive failure opens the circuit so the session cannot loop forever.
604
+ - **Ownership:** generated configs carry `AI_TOOLKIT_HOOK_OWNER=ai-toolkit`; unrelated hook files are not edited.
605
+
606
+ ### Codex CLI hooks (`.codex/hooks.json`)
607
+
608
+ Codex hooks follow the native [Codex hooks contract](https://learn.chatgpt.com/docs/hooks):
609
+
610
+ - **Locations:** repository hooks live in `.codex/hooks.json`; user hooks live in `$CODEX_HOME/hooks.json` (default `~/.codex/hooks.json`). Project hooks load only for a trusted `.codex` layer.
611
+ - **Assets:** repository commands use self-contained `.codex/hooks/*`; user commands use `$CODEX_HOME/ai-toolkit-hooks/*`. They do not call Claude's `~/.softspark/ai-toolkit/hooks/` paths.
612
+ - **Events:** Codex documents 10 events. ai-toolkit wires 9: `SessionStart`, `PreToolUse`, `PostToolUse`, `PermissionRequest`, `UserPromptSubmit`, `SubagentStart`, `SubagentStop`, `PreCompact`, and `Stop`. `PostCompact` is intentionally unwired.
613
+ - **Compaction:** `PreCompact` runs `codex-pre-compact.sh`, a Codex-native reminder that refers to the active `AGENTS.md` chain, plan, and git state. It does not run Claude's `pre-compact.sh` or `pre-compact-save.sh` payload adapters.
614
+ - **Ownership:** native JSON contains no private `_source` keys. Core handlers carry `AI_TOOLKIT_HOOK_OWNER=ai-toolkit` in their command; plugin and external handlers use exact source-specific command markers.
615
+ - **Preservation:** generation replaces only toolkit-owned handlers and assets. Unrelated user handlers and plugin-owned handlers remain intact.
616
+ - **Trust:** installation never bypasses trust. Review the active definitions with `/hooks` after install or update.
581
617
 
582
618
  ### Devin CLI hooks (`.devin/hooks.v1.json`)
583
619
 
@@ -2,10 +2,10 @@
2
2
  title: "AI Toolkit - MCP Editor Compatibility"
3
3
  category: reference
4
4
  service: ai-toolkit
5
- tags: [mcp, editors, compatibility, codex, cursor]
6
- version: "1.1.0"
5
+ tags: [mcp, editors, compatibility, codex, cursor, antigravity]
6
+ version: "1.3.0"
7
7
  created: "2026-04-12"
8
- last_updated: "2026-05-30"
8
+ last_updated: "2026-07-14"
9
9
  description: "Official MCP support matrix and native config targets for editors supported by ai-toolkit."
10
10
  ---
11
11
 
@@ -21,13 +21,14 @@ ai-toolkit keeps `.mcp.json` as the project-level canonical template format and
21
21
  |--------|-------|--------------------|------------------|
22
22
  | Claude Code | project + global | `.claude/settings.local.json`, `~/.claude/settings.json` | Merges `mcpServers` while preserving other settings keys |
23
23
  | Cursor | project + global | `.cursor/mcp.json`, `~/.cursor/mcp.json` | Mirrors `mcpServers` directly |
24
- | GitHub Copilot | project + global | `.github/mcp.json`, `~/.copilot/mcp-config.json` | Adds Copilot-required `type` and `tools` fields |
24
+ | GitHub Copilot | project + global | `.github/mcp.json`, `$COPILOT_HOME/mcp-config.json` (default `~/.copilot/mcp-config.json`) | Adds Copilot-required `type` and `tools` fields |
25
25
  | Gemini CLI | project + global | `.gemini/settings.json`, `~/.gemini/settings.json` | Merges `mcpServers` into settings JSON |
26
+ | Google Antigravity | project + global | `.agents/mcp_config.json`, `~/.gemini/config/mcp_config.json` | Preserves documented `command`, `serverUrl`, and `url` transports plus optional authentication, disablement, and tool-filter fields |
26
27
  | Roo Code | project | `.roo/mcp.json` | Mirrors `mcpServers` into the documented project-level MCP file |
27
28
  | Windsurf | global | `~/.codeium/windsurf/mcp_config.json` | Global-only JSON config |
28
29
  | Cline | global | `~/.cline/data/settings/cline_mcp_settings.json` | Global-only JSON config |
29
30
  | Augment | global | `~/.augment/settings.json` | Global-only JSON settings file |
30
- | Codex CLI | global | `~/.codex/config.toml` | Renders JSON templates as TOML `mcp_servers` tables |
31
+ | Codex CLI | project + global | `.codex/config.toml`, `$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) | Renders validated TOML `mcp_servers` tables inside a managed block while preserving unrelated bytes and comments |
31
32
 
32
33
  ## Unsupported for Automatic Install
33
34
 
@@ -36,13 +37,14 @@ These editors are still supported by ai-toolkit for rules and instructions, but
36
37
  | Editor | Reason |
37
38
  |--------|--------|
38
39
  | Aider | No verified native MCP config surface was adopted in ai-toolkit |
39
- | Google Antigravity | MCP can be configured via UI/import flows, but no stable file target was adopted in ai-toolkit |
40
40
 
41
41
  ## CLI
42
42
 
43
43
  ```bash
44
44
  ai-toolkit mcp editors
45
45
  ai-toolkit mcp install --editor cursor --scope project github --target .
46
+ ai-toolkit mcp install --editor antigravity --scope project context7 --target .
47
+ ai-toolkit mcp install --editor codex --scope project context7 --target .
46
48
  ai-toolkit mcp install --editor codex context7
47
49
  ai-toolkit mcp remove github --editor cursor --scope project --target .
48
50
  ```
@@ -53,7 +55,26 @@ When `.mcp.json` exists in a project, `ai-toolkit install --local` mirrors its s
53
55
  - `.claude/settings.local.json`
54
56
  - `.cursor/mcp.json` when `--editors cursor` is selected
55
57
  - `.github/mcp.json` when `--editors copilot` is selected
58
+ - `.agents/mcp_config.json` when `--editors antigravity` is selected
56
59
  - `.roo/mcp.json` when `--editors roo` is selected
60
+ - `.codex/config.toml` when `--editors codex` is selected; project config is
61
+ active only after the repository `.codex` layer is trusted
62
+
63
+ Codex project and user config preserve unrelated TOML text. ai-toolkit owns only
64
+ the marker-bounded MCP block it generates. Invalid TOML, unsupported transport
65
+ fields, and symlinked config roots are rejected without rewriting the file.
66
+ Portable `type` metadata is translated only when it matches the Codex transport:
67
+ `http` requires `url`, while `local` and `stdio` require `command`. The adapter
68
+ removes that metadata from native TOML and rejects SSE, unknown types, and
69
+ conflicting transport fields before writing.
70
+
71
+ Antigravity project and global configs preserve unrelated top-level keys and
72
+ user-owned servers. The adapter accepts both `serverUrl` and `url` for remote
73
+ servers, as documented by the Antigravity 2.1.4 changelog, but rejects the
74
+ unsupported legacy `httpUrl` field before any file in the transaction changes.
75
+
76
+ `CODEX_HOME` and `COPILOT_HOME` replace their editors' default user config
77
+ roots. They never relocate project files.
57
78
 
58
79
  Global-only clients are configured explicitly via `ai-toolkit mcp install --editor ...`.
59
80
 
@@ -3,9 +3,9 @@ title: "MCP Server Templates"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [mcp, templates, servers, configuration, editors, inject-mcp, external-templates]
6
- version: "1.2.0"
6
+ version: "1.4.0"
7
7
  created: "2026-04-07"
8
- last_updated: "2026-05-12"
8
+ last_updated: "2026-07-14"
9
9
  description: "Reference for 26 built-in MCP server templates, external template injection via inject-mcp, and native editor MCP installation support."
10
10
  ---
11
11
 
@@ -26,6 +26,8 @@ ai-toolkit mcp show <name> # Print a template's JSON config
26
26
  ai-toolkit mcp add <name> # Merge a template into .mcp.json
27
27
  ai-toolkit mcp add <n1> <n2> # Add multiple templates at once
28
28
  ai-toolkit mcp install --editor cursor --scope project github --target .
29
+ ai-toolkit mcp install --editor antigravity --scope project context7 --target .
30
+ ai-toolkit mcp install --editor codex --scope project context7 --target .
29
31
  ai-toolkit mcp install --editor codex context7
30
32
  ai-toolkit mcp remove <name> # Remove from .mcp.json or native editor config
31
33
  ```
@@ -35,7 +37,7 @@ ai-toolkit mcp remove <name> # Remove from .mcp.json or native editor confi
35
37
  The `add` command merges the `mcpServers` block from the template into `.mcp.json`. If `.mcp.json` does not exist it is created. If the server name already exists in `.mcp.json`, the entry is overwritten with the template version.
36
38
 
37
39
  The `install` command renders the same canonical template into an editor-native config format:
38
- - JSON clients with `mcpServers` blocks: Claude Code, Cursor, Gemini CLI, Roo Code, Windsurf, Cline, Augment
40
+ - JSON clients with `mcpServers` blocks: Claude Code, Cursor, Gemini CLI, Google Antigravity, Roo Code, Windsurf, Cline, Augment
39
41
  - JSON clients with additional transport metadata: GitHub Copilot
40
42
  - TOML clients: Codex CLI (`[mcp_servers.<name>]`)
41
43
 
@@ -47,15 +49,19 @@ When `install` runs with `--scope project`, ai-toolkit also updates the project'
47
49
  |--------|-------|--------------------|-------|
48
50
  | `claude` | project + global | `.claude/settings.local.json`, `~/.claude/settings.json` | Preserves existing hooks and env keys |
49
51
  | `cursor` | project + global | `.cursor/mcp.json`, `~/.cursor/mcp.json` | Mirrors canonical `mcpServers` |
50
- | `copilot` | project + global | `.github/mcp.json`, `~/.copilot/mcp-config.json` | Adds `type` and `tools: ["*"]` automatically |
52
+ | `copilot` | project + global | `.github/mcp.json`, `$COPILOT_HOME/mcp-config.json` (default `~/.copilot/mcp-config.json`) | Adds `type` and `tools: ["*"]` automatically |
51
53
  | `gemini` | project + global | `.gemini/settings.json`, `~/.gemini/settings.json` | Uses Gemini CLI `mcpServers` format |
54
+ | `antigravity` | project + global | `.agents/mcp_config.json`, `~/.gemini/config/mcp_config.json` | Preserves `url` or `serverUrl` remote transports and Antigravity authentication/tool-control fields |
52
55
  | `roo` | project | `.roo/mcp.json` | Mirrors canonical `mcpServers` into Roo's project MCP file |
53
56
  | `windsurf` | global | `~/.codeium/windsurf/mcp_config.json` | Global-only official config |
54
57
  | `cline` | global | `~/.cline/data/settings/cline_mcp_settings.json` | Global-only official config |
55
58
  | `augment` | global | `~/.augment/settings.json` | Global-only settings file |
56
- | `codex` | global | `~/.codex/config.toml` | Rendered as TOML `mcp_servers` tables |
59
+ | `codex` | project + global | `.codex/config.toml`, `$CODEX_HOME/config.toml` (default `~/.codex/config.toml`) | Validated TOML `mcp_servers` tables in a marker-bounded managed block; unrelated TOML/comments preserved |
57
60
 
58
- Project-local `ai-toolkit install --local` also mirrors `.mcp.json` into Claude project settings plus selected project editors that have official repository/workspace MCP files (`cursor`, `copilot`, `roo`).
61
+ Project-local `ai-toolkit install --local` also mirrors `.mcp.json` into Claude
62
+ project settings plus selected project editors that have official
63
+ repository/workspace MCP files (`cursor`, `copilot`, `antigravity`, `roo`, `codex`). Codex
64
+ loads `.codex/config.toml` only for trusted project layers.
59
65
 
60
66
  ## Template List
61
67
 
@@ -3,9 +3,9 @@ title: "AI Toolkit - opencode Compatibility"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [opencode, compatibility, install, skills, hooks, mcp, plugins]
6
- version: "1.0.0"
6
+ version: "1.0.1"
7
7
  created: "2026-04-16"
8
- last_updated: "2026-04-16"
8
+ last_updated: "2026-07-14"
9
9
  description: "Reference for how ai-toolkit integrates with opencode — AGENTS.md, subagents, slash commands, JS plugin hook bridge, and MCP merge into opencode.json."
10
10
  ---
11
11
 
@@ -44,16 +44,16 @@ Files land directly under `~/.config/opencode/` (no `.opencode/` nesting) becaus
44
44
  | Feature | Claude Code | Codex CLI | opencode |
45
45
  |--------------------|-------------|-----------------|-------------------------------------------|
46
46
  | Rules file | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` + `CLAUDE.md` fallback |
47
- | Subagents | Yes | No | Yes (`mode: subagent`) |
47
+ | Subagents | Yes | Yes (`.codex/agents/*.toml`) | Yes (`mode: subagent`) |
48
48
  | Slash commands | Skills | Adapted skills | Native commands with frontmatter |
49
49
  | MCP | Yes | Yes | Yes (`opencode.json`) |
50
50
  | Lifecycle hooks | JSON config | `.codex/hooks` | JS/TS plugins (~30+ events) |
51
- | Global config dir | `~/.claude` | `~/.codex` | `~/.config/opencode` |
52
- | Project config dir | `.claude` | `.agents` | `.opencode` |
51
+ | Global config dir | `~/.claude` | `$CODEX_HOME` (default `~/.codex`) | `~/.config/opencode` |
52
+ | Project config dir | `.claude` | `.codex` + `.agents/skills` | `.opencode` |
53
53
 
54
54
  ## Shared AGENTS.md
55
55
 
56
- opencode and Codex CLI both read `AGENTS.md`. The toolkit emits two distinct marker-bounded sections in a single file, so installing both editors does not clobber either. The Codex section is produced by `generate_codex.py`; the opencode section is produced by `generate_opencode.py`. Both sections reuse `codex_skill_adapter.py` because both editors lack Claude-only orchestration primitives (`Agent`, `TeamCreate`, `TaskCreate`).
56
+ opencode and Codex CLI both read `AGENTS.md`. The toolkit emits two distinct marker-bounded sections in a single file, so installing both editors does not clobber either. The Codex section is produced by `generate_codex.py`; the opencode section is produced by `generate_opencode.py`. OpenCode commands use a platform-specific portable renderer for Claude-only orchestration primitives, so generated content uses OpenCode-native wording.
57
57
 
58
58
  ## Subagent Translation Model
59
59
 
@@ -73,6 +73,12 @@ Only user-invocable skills (`user-invocable: true` or no `disable-model-invocati
73
73
 
74
74
  Each command file carries the prompt in its markdown body (built from the SKILL.md body). opencode reads the body as the prompt; the `template` field is JSON-config-only and is ignored in `.md` command files.
75
75
 
76
+ OpenCode natively interpolates `$ARGUMENTS` and positional placeholders `$1`
77
+ through `$9` in command bodies. The renderer preserves those placeholders for
78
+ OpenCode while translating Claude-only skill-directory variables and runtime
79
+ APIs. Codex output uses a separate renderer and converts prompt placeholders to
80
+ durable user-input prose.
81
+
76
82
  ## Hook Bridge (JS Plugin)
77
83
 
78
84
  `.opencode/plugins/ai-toolkit-hooks.js` is a single-file plugin that maps opencode events to the shared Bash hooks in `~/.softspark/ai-toolkit/hooks/`:
@@ -129,7 +135,7 @@ User-authored opencode files and user-authored `opencode.json` keys are never de
129
135
  ## Behavioral Limits
130
136
 
131
137
  - opencode does not expose the full Claude hook event surface; only the events in the mapping table above are bridged. Claude-only events (`TaskCompleted`, `TeammateIdle`, `SubagentStart`, `SubagentStop`, `PreCompact`) are silently skipped.
132
- - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
138
+ - Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/subagent-development`) run through the OpenCode renderer and use OpenCode-native subagents with explicit file ownership.
133
139
 
134
140
  ## Verification
135
141
 
@@ -3,9 +3,9 @@ title: "Plugin Pack Conventions"
3
3
  category: reference
4
4
  service: ai-toolkit
5
5
  tags: [plugins, plugin-packs, conventions, manifests, hooks, policy-packs]
6
- version: "1.0.0"
6
+ version: "1.1.0"
7
7
  created: "2026-03-28"
8
- last_updated: "2026-04-13"
8
+ last_updated: "2026-07-14"
9
9
  description: "Conventions for experimental ai-toolkit plugin packs, policy packs, hook packs, and plugin-creator scaffolding across Claude Code and Codex runtimes."
10
10
  ---
11
11
 
@@ -87,11 +87,11 @@ ai-toolkit plugin status --editor all # show installed packs with r
87
87
  ### What `plugin install` Does
88
88
 
89
89
  1. **Parses** `--editor claude|codex|all` (default: `claude`)
90
- 2. **Copies** plugin-specific hooks to `~/.softspark/ai-toolkit/hooks/plugin-<pack>-<hook>.sh`
91
- 3. **Copies** plugin-specific scripts to `~/.softspark/ai-toolkit/plugin-scripts/<pack>/`
90
+ 2. **Copies** plugin-specific hooks to runtime-owned storage: Claude uses `~/.softspark/ai-toolkit/hooks/plugin-<pack>-<hook>.sh`; Codex uses `$CODEX_HOME/ai-toolkit-hooks/plugin-<pack>-<hook>.sh`
91
+ 3. **Copies** shared plugin scripts to `~/.softspark/ai-toolkit/plugin-scripts/<pack>/`
92
92
  4. **Runs** init scripts if present (e.g. `init_db.py` for memory-pack — safe to re-run, preserves data)
93
93
  5. **Claude Code target**: links missing agents/skills into `~/.claude/`, injects plugin-local rules into `~/.claude/CLAUDE.md`, and merges plugin hook entries into `~/.claude/settings.json`
94
- 6. **Codex target**: bootstraps global Codex assets in `HOME` (`~/AGENTS.md`, `~/.agents/skills`, `~/.agents/rules`, `~/.codex/hooks.json`) and then layers plugin-specific rules/hooks on top
94
+ 6. **Codex target**: bootstraps `$CODEX_HOME/AGENTS.md`, `$HOME/.agents/skills`, `$CODEX_HOME/hooks.json`, and self-contained `$CODEX_HOME/ai-toolkit-hooks`, then layers plugin-specific rules and hooks on top; it does not write `~/AGENTS.md` or `.agents/rules/`
95
95
  7. **Records** installed state per runtime in `~/.softspark/ai-toolkit/plugins.json`
96
96
 
97
97
  ### What `plugin update` Does
@@ -111,8 +111,8 @@ ai-toolkit plugin status --editor all # show installed packs with r
111
111
  ### What `plugin remove` Does
112
112
 
113
113
  1. **Claude Code target**: strips plugin hook entries from `~/.claude/settings.json` and removes plugin-local rule sections from `~/.claude/CLAUDE.md`
114
- 2. **Codex target**: strips plugin hook entries from `~/.codex/hooks.json` and removes `~/.agents/rules/plugin-<pack>-*.md`
115
- 3. **Shared assets** (`~/.softspark/ai-toolkit/hooks/plugin-*`, `plugin-scripts/<pack>/`) are removed only when no remaining runtime still uses that pack
114
+ 2. **Codex target**: strips only command handlers carrying the exact `AI_TOOLKIT_HOOK_OWNER=ai-toolkit-plugin-<pack>` marker from `$CODEX_HOME/hooks.json`, removes owned `$CODEX_HOME/ai-toolkit-hooks/plugin-<pack>-*` assets, and removes the pack's marker-bounded sections from `$CODEX_HOME/AGENTS.md`
115
+ 3. **Claude/shared assets** (`~/.softspark/ai-toolkit/hooks/plugin-*`, `plugin-scripts/<pack>/`) are removed only when no remaining runtime still uses that pack
116
116
  4. **Updates** `plugins.json` state per runtime
117
117
  5. **Leaves** core agents/skills untouched (they belong to the base install)
118
118
  6. **Leaves** plugin data intact (e.g. `memory.db` — use `clean` to prune)
@@ -77,7 +77,7 @@ Hybrid skills combine slash-command invocation with domain knowledge that agents
77
77
  | **cve-scan** | `/cve-scan` | medium | Scan project dependencies for known CVEs using native audit tools (npm, pip, composer, cargo, go, ruby, dart) |
78
78
  | **docs** | `/docs` | high | Generate/update docs: README, API docs, architecture notes, changelogs (Tier 1 — single agent) |
79
79
  | **explain** | `/explain` | medium | Explain architecture of a file/module using Mermaid diagrams |
80
- | **orchestrate** | `/orchestrate` | max | Custom multi-agent parallelism — Tier 3, native in Claude, Codex-adapted to `spawn_agent` workflows |
80
+ | **orchestrate** | `/orchestrate` | max | Custom multi-agent parallelism — Tier 3, native in Claude, Codex-adapted with semantic subagent guidance |
81
81
  | **swarm** | `/swarm` | max | Massive parallelism: map-reduce, consensus, relay — Tier 3 |
82
82
  | **workflow** | `/workflow` | max | 15 predefined multi-agent workflow types — Tier 2, Codex-adapted to native subagent orchestration |
83
83
  | **instinct-review** | `/instinct-review` | low | Review, curate, and manage learned instincts from past sessions |
@@ -257,8 +257,8 @@ Codex CLI receives the full skill catalog during `ai-toolkit install --local --e
257
257
  Claude Chat/Desktop/Cowork receives this same catalog through `ai-toolkit claude-app export`. The export also adds an app-only `ai-toolkit-rules` skill because the Claude app does not read Claude Code's `CLAUDE.md` or `.claude/rules/` surfaces.
258
258
 
259
259
  - Native Codex-compatible skills are symlinked directly into `.agents/skills/`
260
- - Claude-oriented orchestration skills are generated as Codex wrappers
261
- - Adapted wrappers translate `Agent`, `Team*`, and `Task*` guidance to `spawn_agent`, `send_input`, `wait_agent`, `close_agent`, and `update_plan`
260
+ - Skills with Claude-only tools, placeholders, path variables, or orchestration APIs are generated as Codex wrappers
261
+ - Adapted wrappers describe subagent control, waiting, and planning as durable current-client semantics without embedding guessed tool signatures
262
262
 
263
263
  Common adapted skills:
264
264