@softspark/ai-toolkit 2.4.1 → 2.6.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/AGENTS.md +33 -20
- package/CHANGELOG.md +57 -0
- package/README.md +29 -13
- package/app/.claude-plugin/plugin.json +3 -2
- package/app/ARCHITECTURE.md +11 -0
- package/app/agents/code-reviewer.md +6 -7
- package/app/agents/frontend-specialist.md +33 -2
- package/app/agents/seo-specialist.md +1 -1
- package/app/personas/frontend-lead.md +48 -5
- package/app/skills/a11y-validate/SKILL.md +377 -0
- package/app/skills/a11y-validate/reference/aria-patterns.md +259 -0
- package/app/skills/a11y-validate/reference/eaa-compliance.md +252 -0
- package/app/skills/a11y-validate/reference/mobile-eaa.md +329 -0
- package/app/skills/a11y-validate/reference/wcag-2-1-aa.md +285 -0
- package/app/skills/a11y-validate/reference/wcag-2-2-aa.md +221 -0
- package/app/skills/a11y-validate/scripts/a11y-scanner.py +639 -0
- package/app/skills/clean-code/reference/python.md +3 -3
- package/app/skills/design-engineering/SKILL.md +2 -5
- package/app/skills/hipaa-validate/SKILL.md +39 -23
- package/app/skills/hipaa-validate/scripts/hipaa_scan.py +64 -7
- package/app/skills/review/SKILL.md +30 -6
- package/app/skills/seo-validate/SKILL.md +460 -0
- package/app/skills/seo-validate/reference/core-web-vitals.md +445 -0
- package/app/skills/seo-validate/reference/geo-aeo-patterns.md +259 -0
- package/app/skills/seo-validate/reference/geo-guidelines.md +248 -0
- package/app/skills/seo-validate/reference/schema-types.md +465 -0
- package/app/skills/seo-validate/reference/spa-ssg-patterns.md +351 -0
- package/app/skills/seo-validate/reference/w3c-guidelines.md +289 -0
- package/app/skills/seo-validate/scripts/seo-scanner.py +549 -0
- package/bin/ai-toolkit.js +24 -9
- package/kb/reference/architecture-overview.md +1 -1
- package/kb/reference/comparison.md +1 -1
- package/kb/reference/opencode-compatibility.md +161 -0
- package/kb/reference/skills-catalog.md +3 -1
- package/llms-full.txt +177 -6
- package/llms.txt +1 -0
- package/manifest.json +3 -3
- package/package.json +6 -3
- package/scripts/config_cli.py +4 -10
- package/scripts/doctor.py +3 -3
- package/scripts/generate_opencode.py +117 -0
- package/scripts/generate_opencode_agents.py +126 -0
- package/scripts/generate_opencode_commands.py +158 -0
- package/scripts/generate_opencode_json.py +133 -0
- package/scripts/generate_opencode_plugin.py +169 -0
- package/scripts/install_steps/ai_tools.py +117 -1
- package/scripts/install_steps/install_state.py +1 -1
- package/scripts/plugin.py +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "AI Toolkit - opencode Compatibility"
|
|
3
|
+
category: reference
|
|
4
|
+
service: ai-toolkit
|
|
5
|
+
tags: [opencode, compatibility, install, skills, hooks, mcp, plugins]
|
|
6
|
+
version: "1.0.0"
|
|
7
|
+
created: "2026-04-16"
|
|
8
|
+
last_updated: "2026-04-16"
|
|
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
|
+
---
|
|
11
|
+
|
|
12
|
+
# AI Toolkit - opencode Compatibility
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
opencode (https://opencode.ai) is the 11th supported editor. `ai-toolkit install --editors opencode` (or `--editors all`) lays down a full native integration: shared `AGENTS.md`, per-agent `.opencode/agents/` files, per-command `.opencode/commands/` files, a JS plugin bridging toolkit Bash hooks to opencode lifecycle events, and MCP server merge into `opencode.json`.
|
|
17
|
+
|
|
18
|
+
opencode also reads `CLAUDE.md` as a fallback, so a user without the native integration still gets baseline rules. The native path adds subagents, slash commands, hooks, and MCP.
|
|
19
|
+
|
|
20
|
+
## Local Install Outputs
|
|
21
|
+
|
|
22
|
+
`ai-toolkit install --local --editors opencode` generates:
|
|
23
|
+
|
|
24
|
+
- `AGENTS.md` (shared with Codex CLI via distinct marker sections)
|
|
25
|
+
- `.opencode/agents/ai-toolkit-*.md` (one per ai-toolkit agent, `mode: subagent`)
|
|
26
|
+
- `.opencode/commands/ai-toolkit-*.md` (one per user-invocable skill, required `template: |` frontmatter field)
|
|
27
|
+
- `.opencode/plugins/ai-toolkit-hooks.js` (JS plugin bridging Bash hooks)
|
|
28
|
+
- `opencode.json` (MCP key merged from `.mcp.json`, user keys preserved)
|
|
29
|
+
|
|
30
|
+
## Global Install Outputs
|
|
31
|
+
|
|
32
|
+
`ai-toolkit install --editors opencode` (no `--local`) lays down:
|
|
33
|
+
|
|
34
|
+
- `~/.config/opencode/AGENTS.md`
|
|
35
|
+
- `~/.config/opencode/agents/ai-toolkit-*.md`
|
|
36
|
+
- `~/.config/opencode/commands/ai-toolkit-*.md`
|
|
37
|
+
- `~/.config/opencode/plugins/ai-toolkit-hooks.js`
|
|
38
|
+
- `~/.config/opencode/opencode.json` (MCP merge, user keys preserved)
|
|
39
|
+
|
|
40
|
+
Files land directly under `~/.config/opencode/` (no `.opencode/` nesting) because that is the global layout opencode expects per https://opencode.ai/docs/config/. Shared hook scripts stay in `~/.softspark/ai-toolkit/hooks/` and are referenced by the global JS plugin.
|
|
41
|
+
|
|
42
|
+
## Editor Surface Comparison
|
|
43
|
+
|
|
44
|
+
| Feature | Claude Code | Codex CLI | opencode |
|
|
45
|
+
|--------------------|-------------|-----------------|-------------------------------------------|
|
|
46
|
+
| Rules file | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` + `CLAUDE.md` fallback |
|
|
47
|
+
| Subagents | Yes | No | Yes (`mode: subagent`) |
|
|
48
|
+
| Slash commands | Skills | Adapted skills | Native commands with frontmatter |
|
|
49
|
+
| MCP | Yes | Yes | Yes (`opencode.json`) |
|
|
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` |
|
|
53
|
+
|
|
54
|
+
## Shared AGENTS.md
|
|
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`).
|
|
57
|
+
|
|
58
|
+
## Subagent Translation Model
|
|
59
|
+
|
|
60
|
+
Each file in `app/agents/*.md` emits a corresponding `.opencode/agents/ai-toolkit-<name>.md` with:
|
|
61
|
+
|
|
62
|
+
- `description` — copied from the source agent frontmatter
|
|
63
|
+
- `mode: subagent` (required)
|
|
64
|
+
- `color` — copied when present
|
|
65
|
+
|
|
66
|
+
The `model` field is deliberately omitted. opencode requires the `provider/model-id` form; ai-toolkit only stores a short alias (`opus`/`sonnet`/`haiku`) which cannot be mapped without assuming a provider. opencode falls back to the user's `default_agent` / top-level `model` config.
|
|
67
|
+
|
|
68
|
+
Opencode treats these files as auto-completable with `@` and can delegate to them from the primary agent.
|
|
69
|
+
|
|
70
|
+
## Slash Command Translation Model
|
|
71
|
+
|
|
72
|
+
Only user-invocable skills (`user-invocable: true` or no `disable-model-invocation`) emit to `.opencode/commands/`. Knowledge skills (`user-invocable: false`) are intentionally skipped — they are not intended as commands.
|
|
73
|
+
|
|
74
|
+
Each command file carries opencode's required `template: |` frontmatter field, built from the SKILL.md body.
|
|
75
|
+
|
|
76
|
+
## Hook Bridge (JS Plugin)
|
|
77
|
+
|
|
78
|
+
`.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/`:
|
|
79
|
+
|
|
80
|
+
| opencode event | Bash hook(s) |
|
|
81
|
+
|----------------------------|--------------------------------------------------------------------|
|
|
82
|
+
| `session.created` | `session-start.sh` + `session-context.sh` + `mcp-health.sh` |
|
|
83
|
+
| `session.compacted` | `pre-compact.sh` + `pre-compact-save.sh` (PreCompact equivalent) |
|
|
84
|
+
| `session.deleted` | `session-end.sh` + `save-session.sh` |
|
|
85
|
+
| `message.updated` | `user-prompt-submit.sh` + `track-usage.sh` |
|
|
86
|
+
| `message.part.updated` | `user-prompt-submit.sh` + `track-usage.sh` |
|
|
87
|
+
| `tool.execute.before` (bash) | `guard-destructive.sh` + `commit-quality.sh` |
|
|
88
|
+
| `tool.execute.after` | `post-tool-use.sh` |
|
|
89
|
+
| `permission.asked` | `guard-destructive.sh` (approval-gate bridge) |
|
|
90
|
+
| `command.executed` | `post-tool-use.sh` |
|
|
91
|
+
|
|
92
|
+
Plugin exports a single named export `AiToolkitHooks` — per opencode docs, named exports only (no default export). Hook scripts are invoked via Bun's `$` with the script path bound as a JS constant; opencode event payloads are passed as JSON on stdin, never interpolated into the shell command, so payload data cannot inject shell metacharacters. The toolkit's `exit 2` semantics for PreToolUse guards are preserved and bubble up as the plugin's return code.
|
|
93
|
+
|
|
94
|
+
**Intentionally unmapped events**: `tui.*`, `lsp.*`, `installation.*`, `session.idle/status/updated/error/diff`, `file.edited`, `file.watcher.updated`, `todo.updated`, `shell.env`, `server.connected`, `message.*.removed`, `experimental.*` — no matching Bash hook in the toolkit, or the event is opencode-UI-only.
|
|
95
|
+
|
|
96
|
+
## MCP Merge (opencode.json)
|
|
97
|
+
|
|
98
|
+
`generate_opencode_json.py` reads `.mcp.json` and merges its servers under the `mcp` key in `opencode.json`:
|
|
99
|
+
|
|
100
|
+
- `local` shape entries are translated to opencode's local command shape.
|
|
101
|
+
- `remote` shape entries are translated to opencode's remote URL shape.
|
|
102
|
+
- User-authored keys in `opencode.json` (outside `mcp`) are preserved.
|
|
103
|
+
- Re-running the generator is idempotent.
|
|
104
|
+
|
|
105
|
+
## Auto-Detection
|
|
106
|
+
|
|
107
|
+
The installer detects opencode as configured when any of these markers exist:
|
|
108
|
+
|
|
109
|
+
- `opencode.json`
|
|
110
|
+
- `.opencode/` directory
|
|
111
|
+
- `.opencode/agents/`
|
|
112
|
+
- `.opencode/commands/`
|
|
113
|
+
- `~/.config/opencode/`
|
|
114
|
+
|
|
115
|
+
`ai-toolkit update` picks up opencode automatically when detection fires.
|
|
116
|
+
|
|
117
|
+
## Uninstall & Reset
|
|
118
|
+
|
|
119
|
+
`scripts/install_steps/ai_tools.py` cleanup only removes ai-toolkit-marked artifacts:
|
|
120
|
+
|
|
121
|
+
- Generated `.opencode/agents/ai-toolkit-*.md`
|
|
122
|
+
- Generated `.opencode/commands/ai-toolkit-*.md`
|
|
123
|
+
- Generated `.opencode/plugins/ai-toolkit-hooks.js`
|
|
124
|
+
- Managed markers from `AGENTS.md`
|
|
125
|
+
- `mcp` key entries injected by the toolkit (user keys preserved)
|
|
126
|
+
|
|
127
|
+
User-authored opencode files and user-authored `opencode.json` keys are never deleted.
|
|
128
|
+
|
|
129
|
+
## Behavioral Limits
|
|
130
|
+
|
|
131
|
+
- 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`, `/teams`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
|
|
133
|
+
|
|
134
|
+
## Verification
|
|
135
|
+
|
|
136
|
+
The opencode integration is verified by:
|
|
137
|
+
|
|
138
|
+
1. Generator contract tests for the five `generate_opencode*.py` scripts (bats)
|
|
139
|
+
2. MCP merge idempotency and user-key preservation tests
|
|
140
|
+
3. Plugin export shape and event coverage tests
|
|
141
|
+
4. Auto-detection tests for install / update flow
|
|
142
|
+
5. `validate.py --strict` + `audit_skills.py --ci` in CI
|
|
143
|
+
|
|
144
|
+
## CLI Commands
|
|
145
|
+
|
|
146
|
+
| Command | Description |
|
|
147
|
+
|---------|-------------|
|
|
148
|
+
| `ai-toolkit opencode-md` | Generate `AGENTS.md` body for opencode |
|
|
149
|
+
| `ai-toolkit opencode-agents` | Generate `.opencode/agents/ai-toolkit-*.md` |
|
|
150
|
+
| `ai-toolkit opencode-commands` | Generate `.opencode/commands/ai-toolkit-*.md` |
|
|
151
|
+
| `ai-toolkit opencode-plugin` | Generate `.opencode/plugins/ai-toolkit-hooks.js` |
|
|
152
|
+
| `ai-toolkit opencode-json` | Merge MCP servers into `opencode.json` |
|
|
153
|
+
|
|
154
|
+
## Related
|
|
155
|
+
|
|
156
|
+
- `kb/reference/skills-catalog.md`
|
|
157
|
+
- `kb/reference/agents-catalog.md`
|
|
158
|
+
- `kb/reference/codex-cli-compatibility.md`
|
|
159
|
+
- `kb/reference/architecture-overview.md`
|
|
160
|
+
- `kb/reference/global-install-model.md`
|
|
161
|
+
- `kb/reference/mcp-editor-compatibility.md`
|
|
@@ -23,7 +23,7 @@ All functionality is unified under skills. Task and hybrid skills are user-invoc
|
|
|
23
23
|
| **2 — Multi-agent workflow** | `/workflow <type>` | Cross-cutting task with known pattern |
|
|
24
24
|
| **3 — Custom parallelism** | `/orchestrate`, `/swarm` | No predefined workflow matches |
|
|
25
25
|
|
|
26
|
-
## Task Skills (
|
|
26
|
+
## Task Skills (30)
|
|
27
27
|
|
|
28
28
|
Task skills execute a specific action. Invoked via slash commands. `disable-model-invocation: true`.
|
|
29
29
|
|
|
@@ -58,6 +58,8 @@ Task skills execute a specific action. Invoked via slash commands. `disable-mode
|
|
|
58
58
|
| **prd-to-issues** | `/prd-to-issues` | medium | Break PRD into GitHub issues with vertical slices and HITL/AFK tagging |
|
|
59
59
|
| **skill-audit** | `/skill-audit` | medium | Scan skills and agents for security risks: dangerous patterns, secrets, excessive permissions |
|
|
60
60
|
| **hipaa-validate** | `/hipaa-validate` | medium | Scan codebase for HIPAA compliance issues: PHI exposure, missing audit logging, unencrypted transmission/storage, access control gaps, temp file exposure, and missing BAA references |
|
|
61
|
+
| **a11y-validate** | `/a11y-validate` | medium | Scan codebase for accessibility violations: WCAG 2.1 Level AA, EN 301 549, European Accessibility Act (EAA / EU 2019/882). Covers semantics, keyboard, focus, color contrast, forms, media, ARIA, motion, mobile (React Native + Flutter), and EAA accessibility-statement documentation. |
|
|
62
|
+
| **seo-validate** | `/seo-validate` | medium | Scan codebase for SEO issues: W3C semantics, meta/OG tags, Schema.org, hreflang, Core Web Vitals (LCP/INP/CLS), resource hints, GEO, SPA/SSG/CSR crawlability, technical SEO, accessibility-for-SEO. Framework-aware (Next/Nuxt/Astro/Gatsby/SvelteKit/Remix/Angular/Vue/static HTML). |
|
|
61
63
|
|
|
62
64
|
## Hybrid Skills (31)
|
|
63
65
|
|
package/llms-full.txt
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
- [MCP Editor Compatibility](kb/reference/mcp-editor-compatibility.md)
|
|
45
45
|
- [MCP Server Templates](kb/reference/mcp-templates.md)
|
|
46
46
|
- [Merge-Friendly Install Model](kb/reference/merge-friendly-install-model.md)
|
|
47
|
+
- [AI Toolkit - opencode Compatibility](kb/reference/opencode-compatibility.md)
|
|
47
48
|
- [Plugin Pack Conventions](kb/reference/plugin-pack-conventions.md)
|
|
48
49
|
- [Quick Wins Implementation Summary](kb/reference/quick-wins-implementation-summary.md)
|
|
49
50
|
- [Skill Templates](kb/reference/skill-templates.md)
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
|
|
57
58
|
## Skills
|
|
58
59
|
|
|
60
|
+
- **a11y-validate**: Validate code against accessibility standards: WCAG 2.1 Level AA, EN 301 549, and the European Accessibility Act (EAA / Directive EU 2019/882). Covers semantics, text alternatives, keyboard/focus, color/contrast, forms, media, ARIA, motion, mobile, and EAA documentation requirements. Framework-aware (React/Next/Nuxt/Astro/Gatsby/SvelteKit/Remix/Angular/Vue/React Native/Flutter/static HTML).
|
|
59
61
|
- **agent-creator**: Creates new specialized agents with frontmatter, tool selection, and delegation guidance
|
|
60
62
|
- **analyze**: Analyze code quality, complexity, and patterns
|
|
61
63
|
- **api-patterns**: Loaded when user asks about REST API design or GraphQL patterns
|
|
@@ -133,6 +135,7 @@
|
|
|
133
135
|
- **rust-patterns**: Loaded when user asks about Rust development patterns
|
|
134
136
|
- **search**: Search the knowledge base with semantic and hybrid modes
|
|
135
137
|
- **security-patterns**: Loaded when user asks about security, OWASP, or auth patterns
|
|
138
|
+
- **seo-validate**: Validate code against SEO best practices: W3C semantics, meta/OG tags, Schema.org, hreflang, Core Web Vitals (LCP/INP/CLS), resource hints, GEO, SPA/SSG/CSR crawlability, technical SEO, accessibility-for-SEO. Supports React/Next/Nuxt/Astro/Gatsby/SvelteKit/Remix/Angular/Vue/static HTML.
|
|
136
139
|
- **skill-audit**: Scan skills and agents for security risks: dangerous patterns, secrets, excessive permissions
|
|
137
140
|
- **skill-creator**: Create new skills from templates with guided workflow
|
|
138
141
|
- **subagent-development**: Execute implementation plans using fresh subagents per task with two-stage review: spec compliance first, then code quality. Use when executing plans with independent tasks.
|
|
@@ -4456,7 +4459,7 @@ service: ai-toolkit
|
|
|
4456
4459
|
tags: [architecture, overview, design, structure]
|
|
4457
4460
|
version: "1.4.4"
|
|
4458
4461
|
created: "2026-03-23"
|
|
4459
|
-
last_updated: "2026-04-
|
|
4462
|
+
last_updated: "2026-04-15"
|
|
4460
4463
|
description: "Architecture of ai-toolkit: directory layout, global install model, editor-aware MCP install, Codex translation layer, skill tiers, and integration with projects."
|
|
4461
4464
|
---
|
|
4462
4465
|
|
|
@@ -4636,7 +4639,7 @@ Three tiers determine how to approach a task:
|
|
|
4636
4639
|
|
|
4637
4640
|
| Type | Field | Invocation | Count |
|
|
4638
4641
|
|------|-------|-----------|-------|
|
|
4639
|
-
| Task | `disable-model-invocation: true` | User via `/skill` only |
|
|
4642
|
+
| Task | `disable-model-invocation: true` | User via `/skill` only | 31 |
|
|
4640
4643
|
| Hybrid | (neither) | User via `/skill` + agent knowledge | 31 |
|
|
4641
4644
|
| Knowledge | `user-invocable: false` | Claude auto-loads | 32 |
|
|
4642
4645
|
|
|
@@ -4786,7 +4789,7 @@ Severity levels: HIGH (blocks deployment), WARN (should fix), INFO (best practic
|
|
|
4786
4789
|
## Extension Points
|
|
4787
4790
|
|
|
4788
4791
|
### MCP Templates
|
|
4789
|
-
`app/
|
|
4792
|
+
`app/mcp-templates/` contains 26 ready-to-use MCP server config templates. Opt-in via `ai-toolkit install --modules mcp-templates` or activated automatically with `--profile strict|full`.
|
|
4790
4793
|
|
|
4791
4794
|
### Language Rules
|
|
4792
4795
|
`app/rules/` provides language-specific rule files covering 13 languages (TypeScript, Python, Go, Rust, Java, Kotlin, Swift, Dart, C#, PHP, C++, Ruby, common). Auto-detected from project files via `--auto-detect` or selectable with `--modules rules-<lang>`. See README.md for current count.
|
|
@@ -5137,7 +5140,7 @@ category: reference
|
|
|
5137
5140
|
service: ai-toolkit
|
|
5138
5141
|
tags: [cli, commands, reference, install, update, plugin, mcp]
|
|
5139
5142
|
created: "2026-04-13"
|
|
5140
|
-
last_updated: "2026-04-
|
|
5143
|
+
last_updated: "2026-04-15"
|
|
5141
5144
|
description: "Complete CLI reference for all ai-toolkit commands, options, and flags."
|
|
5142
5145
|
---
|
|
5143
5146
|
|
|
@@ -5430,7 +5433,7 @@ description: "Feature comparison of ai-toolkit vs other Claude Code toolkits and
|
|
|
5430
5433
|
|
|
5431
5434
|
| Feature | ai-toolkit | everything-claude-code | wshobson/agents | ruflo |
|
|
5432
5435
|
|---------|---------------|----------------------|-----------------|-------|
|
|
5433
|
-
| Skills |
|
|
5436
|
+
| Skills | 93 | 100+ | 146 | 20+ |
|
|
5434
5437
|
| Agents | 44 | 30+ | 112 | 20+ |
|
|
5435
5438
|
| Machine-enforced constitution | **Yes** | No (docs only) | No | No |
|
|
5436
5439
|
| Skill-scoped lifecycle hooks | **Yes** | No | No | No |
|
|
@@ -8239,6 +8242,172 @@ Project-local setup uses the same preservation approach for files that should re
|
|
|
8239
8242
|
|
|
8240
8243
|
---
|
|
8241
8244
|
|
|
8245
|
+
## kb/reference/opencode-compatibility.md
|
|
8246
|
+
|
|
8247
|
+
---
|
|
8248
|
+
title: "AI Toolkit - opencode Compatibility"
|
|
8249
|
+
category: reference
|
|
8250
|
+
service: ai-toolkit
|
|
8251
|
+
tags: [opencode, compatibility, install, skills, hooks, mcp, plugins]
|
|
8252
|
+
version: "1.0.0"
|
|
8253
|
+
created: "2026-04-16"
|
|
8254
|
+
last_updated: "2026-04-16"
|
|
8255
|
+
description: "Reference for how ai-toolkit integrates with opencode — AGENTS.md, subagents, slash commands, JS plugin hook bridge, and MCP merge into opencode.json."
|
|
8256
|
+
---
|
|
8257
|
+
|
|
8258
|
+
# AI Toolkit - opencode Compatibility
|
|
8259
|
+
|
|
8260
|
+
## Summary
|
|
8261
|
+
|
|
8262
|
+
opencode (https://opencode.ai) is the 11th supported editor. `ai-toolkit install --editors opencode` (or `--editors all`) lays down a full native integration: shared `AGENTS.md`, per-agent `.opencode/agents/` files, per-command `.opencode/commands/` files, a JS plugin bridging toolkit Bash hooks to opencode lifecycle events, and MCP server merge into `opencode.json`.
|
|
8263
|
+
|
|
8264
|
+
opencode also reads `CLAUDE.md` as a fallback, so a user without the native integration still gets baseline rules. The native path adds subagents, slash commands, hooks, and MCP.
|
|
8265
|
+
|
|
8266
|
+
## Local Install Outputs
|
|
8267
|
+
|
|
8268
|
+
`ai-toolkit install --local --editors opencode` generates:
|
|
8269
|
+
|
|
8270
|
+
- `AGENTS.md` (shared with Codex CLI via distinct marker sections)
|
|
8271
|
+
- `.opencode/agents/ai-toolkit-*.md` (one per ai-toolkit agent, `mode: subagent`)
|
|
8272
|
+
- `.opencode/commands/ai-toolkit-*.md` (one per user-invocable skill, required `template: |` frontmatter field)
|
|
8273
|
+
- `.opencode/plugins/ai-toolkit-hooks.js` (JS plugin bridging Bash hooks)
|
|
8274
|
+
- `opencode.json` (MCP key merged from `.mcp.json`, user keys preserved)
|
|
8275
|
+
|
|
8276
|
+
## Global Install Outputs
|
|
8277
|
+
|
|
8278
|
+
`ai-toolkit install --editors opencode` (no `--local`) lays down:
|
|
8279
|
+
|
|
8280
|
+
- `~/.config/opencode/AGENTS.md`
|
|
8281
|
+
- `~/.config/opencode/agents/ai-toolkit-*.md`
|
|
8282
|
+
- `~/.config/opencode/commands/ai-toolkit-*.md`
|
|
8283
|
+
- `~/.config/opencode/plugins/ai-toolkit-hooks.js`
|
|
8284
|
+
- `~/.config/opencode/opencode.json` (MCP merge, user keys preserved)
|
|
8285
|
+
|
|
8286
|
+
Files land directly under `~/.config/opencode/` (no `.opencode/` nesting) because that is the global layout opencode expects per https://opencode.ai/docs/config/. Shared hook scripts stay in `~/.softspark/ai-toolkit/hooks/` and are referenced by the global JS plugin.
|
|
8287
|
+
|
|
8288
|
+
## Editor Surface Comparison
|
|
8289
|
+
|
|
8290
|
+
| Feature | Claude Code | Codex CLI | opencode |
|
|
8291
|
+
|--------------------|-------------|-----------------|-------------------------------------------|
|
|
8292
|
+
| Rules file | `CLAUDE.md` | `AGENTS.md` | `AGENTS.md` + `CLAUDE.md` fallback |
|
|
8293
|
+
| Subagents | Yes | No | Yes (`mode: subagent`) |
|
|
8294
|
+
| Slash commands | Skills | Adapted skills | Native commands with frontmatter |
|
|
8295
|
+
| MCP | Yes | Yes | Yes (`opencode.json`) |
|
|
8296
|
+
| Lifecycle hooks | JSON config | `.codex/hooks` | JS/TS plugins (~30+ events) |
|
|
8297
|
+
| Global config dir | `~/.claude` | `~/.codex` | `~/.config/opencode` |
|
|
8298
|
+
| Project config dir | `.claude` | `.agents` | `.opencode` |
|
|
8299
|
+
|
|
8300
|
+
## Shared AGENTS.md
|
|
8301
|
+
|
|
8302
|
+
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`).
|
|
8303
|
+
|
|
8304
|
+
## Subagent Translation Model
|
|
8305
|
+
|
|
8306
|
+
Each file in `app/agents/*.md` emits a corresponding `.opencode/agents/ai-toolkit-<name>.md` with:
|
|
8307
|
+
|
|
8308
|
+
- `description` — copied from the source agent frontmatter
|
|
8309
|
+
- `mode: subagent` (required)
|
|
8310
|
+
- `color` — copied when present
|
|
8311
|
+
|
|
8312
|
+
The `model` field is deliberately omitted. opencode requires the `provider/model-id` form; ai-toolkit only stores a short alias (`opus`/`sonnet`/`haiku`) which cannot be mapped without assuming a provider. opencode falls back to the user's `default_agent` / top-level `model` config.
|
|
8313
|
+
|
|
8314
|
+
Opencode treats these files as auto-completable with `@` and can delegate to them from the primary agent.
|
|
8315
|
+
|
|
8316
|
+
## Slash Command Translation Model
|
|
8317
|
+
|
|
8318
|
+
Only user-invocable skills (`user-invocable: true` or no `disable-model-invocation`) emit to `.opencode/commands/`. Knowledge skills (`user-invocable: false`) are intentionally skipped — they are not intended as commands.
|
|
8319
|
+
|
|
8320
|
+
Each command file carries opencode's required `template: |` frontmatter field, built from the SKILL.md body.
|
|
8321
|
+
|
|
8322
|
+
## Hook Bridge (JS Plugin)
|
|
8323
|
+
|
|
8324
|
+
`.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/`:
|
|
8325
|
+
|
|
8326
|
+
| opencode event | Bash hook(s) |
|
|
8327
|
+
|----------------------------|--------------------------------------------------------------------|
|
|
8328
|
+
| `session.created` | `session-start.sh` + `session-context.sh` + `mcp-health.sh` |
|
|
8329
|
+
| `session.compacted` | `pre-compact.sh` + `pre-compact-save.sh` (PreCompact equivalent) |
|
|
8330
|
+
| `session.deleted` | `session-end.sh` + `save-session.sh` |
|
|
8331
|
+
| `message.updated` | `user-prompt-submit.sh` + `track-usage.sh` |
|
|
8332
|
+
| `message.part.updated` | `user-prompt-submit.sh` + `track-usage.sh` |
|
|
8333
|
+
| `tool.execute.before` (bash) | `guard-destructive.sh` + `commit-quality.sh` |
|
|
8334
|
+
| `tool.execute.after` | `post-tool-use.sh` |
|
|
8335
|
+
| `permission.asked` | `guard-destructive.sh` (approval-gate bridge) |
|
|
8336
|
+
| `command.executed` | `post-tool-use.sh` |
|
|
8337
|
+
|
|
8338
|
+
Plugin exports a single named export `AiToolkitHooks` — per opencode docs, named exports only (no default export). Hook scripts are invoked via Bun's `$` with the script path bound as a JS constant; opencode event payloads are passed as JSON on stdin, never interpolated into the shell command, so payload data cannot inject shell metacharacters. The toolkit's `exit 2` semantics for PreToolUse guards are preserved and bubble up as the plugin's return code.
|
|
8339
|
+
|
|
8340
|
+
**Intentionally unmapped events**: `tui.*`, `lsp.*`, `installation.*`, `session.idle/status/updated/error/diff`, `file.edited`, `file.watcher.updated`, `todo.updated`, `shell.env`, `server.connected`, `message.*.removed`, `experimental.*` — no matching Bash hook in the toolkit, or the event is opencode-UI-only.
|
|
8341
|
+
|
|
8342
|
+
## MCP Merge (opencode.json)
|
|
8343
|
+
|
|
8344
|
+
`generate_opencode_json.py` reads `.mcp.json` and merges its servers under the `mcp` key in `opencode.json`:
|
|
8345
|
+
|
|
8346
|
+
- `local` shape entries are translated to opencode's local command shape.
|
|
8347
|
+
- `remote` shape entries are translated to opencode's remote URL shape.
|
|
8348
|
+
- User-authored keys in `opencode.json` (outside `mcp`) are preserved.
|
|
8349
|
+
- Re-running the generator is idempotent.
|
|
8350
|
+
|
|
8351
|
+
## Auto-Detection
|
|
8352
|
+
|
|
8353
|
+
The installer detects opencode as configured when any of these markers exist:
|
|
8354
|
+
|
|
8355
|
+
- `opencode.json`
|
|
8356
|
+
- `.opencode/` directory
|
|
8357
|
+
- `.opencode/agents/`
|
|
8358
|
+
- `.opencode/commands/`
|
|
8359
|
+
- `~/.config/opencode/`
|
|
8360
|
+
|
|
8361
|
+
`ai-toolkit update` picks up opencode automatically when detection fires.
|
|
8362
|
+
|
|
8363
|
+
## Uninstall & Reset
|
|
8364
|
+
|
|
8365
|
+
`scripts/install_steps/ai_tools.py` cleanup only removes ai-toolkit-marked artifacts:
|
|
8366
|
+
|
|
8367
|
+
- Generated `.opencode/agents/ai-toolkit-*.md`
|
|
8368
|
+
- Generated `.opencode/commands/ai-toolkit-*.md`
|
|
8369
|
+
- Generated `.opencode/plugins/ai-toolkit-hooks.js`
|
|
8370
|
+
- Managed markers from `AGENTS.md`
|
|
8371
|
+
- `mcp` key entries injected by the toolkit (user keys preserved)
|
|
8372
|
+
|
|
8373
|
+
User-authored opencode files and user-authored `opencode.json` keys are never deleted.
|
|
8374
|
+
|
|
8375
|
+
## Behavioral Limits
|
|
8376
|
+
|
|
8377
|
+
- 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.
|
|
8378
|
+
- Multi-agent orchestration skills (`/orchestrate`, `/workflow`, `/swarm`, `/teams`, `/subagent-development`) run through the Codex adaptation layer — they use opencode subagents and explicit file ownership instead of Claude's `Agent`/`TaskCreate` primitives.
|
|
8379
|
+
|
|
8380
|
+
## Verification
|
|
8381
|
+
|
|
8382
|
+
The opencode integration is verified by:
|
|
8383
|
+
|
|
8384
|
+
1. Generator contract tests for the five `generate_opencode*.py` scripts (bats)
|
|
8385
|
+
2. MCP merge idempotency and user-key preservation tests
|
|
8386
|
+
3. Plugin export shape and event coverage tests
|
|
8387
|
+
4. Auto-detection tests for install / update flow
|
|
8388
|
+
5. `validate.py --strict` + `audit_skills.py --ci` in CI
|
|
8389
|
+
|
|
8390
|
+
## CLI Commands
|
|
8391
|
+
|
|
8392
|
+
| Command | Description |
|
|
8393
|
+
|---------|-------------|
|
|
8394
|
+
| `ai-toolkit opencode-md` | Generate `AGENTS.md` body for opencode |
|
|
8395
|
+
| `ai-toolkit opencode-agents` | Generate `.opencode/agents/ai-toolkit-*.md` |
|
|
8396
|
+
| `ai-toolkit opencode-commands` | Generate `.opencode/commands/ai-toolkit-*.md` |
|
|
8397
|
+
| `ai-toolkit opencode-plugin` | Generate `.opencode/plugins/ai-toolkit-hooks.js` |
|
|
8398
|
+
| `ai-toolkit opencode-json` | Merge MCP servers into `opencode.json` |
|
|
8399
|
+
|
|
8400
|
+
## Related
|
|
8401
|
+
|
|
8402
|
+
- `kb/reference/skills-catalog.md`
|
|
8403
|
+
- `kb/reference/agents-catalog.md`
|
|
8404
|
+
- `kb/reference/codex-cli-compatibility.md`
|
|
8405
|
+
- `kb/reference/architecture-overview.md`
|
|
8406
|
+
- `kb/reference/global-install-model.md`
|
|
8407
|
+
- `kb/reference/mcp-editor-compatibility.md`
|
|
8408
|
+
|
|
8409
|
+
---
|
|
8410
|
+
|
|
8242
8411
|
## kb/reference/plugin-pack-conventions.md
|
|
8243
8412
|
|
|
8244
8413
|
---
|
|
@@ -8553,7 +8722,7 @@ All functionality is unified under skills. Task and hybrid skills are user-invoc
|
|
|
8553
8722
|
| **2 — Multi-agent workflow** | `/workflow <type>` | Cross-cutting task with known pattern |
|
|
8554
8723
|
| **3 — Custom parallelism** | `/orchestrate`, `/swarm` | No predefined workflow matches |
|
|
8555
8724
|
|
|
8556
|
-
## Task Skills (
|
|
8725
|
+
## Task Skills (30)
|
|
8557
8726
|
|
|
8558
8727
|
Task skills execute a specific action. Invoked via slash commands. `disable-model-invocation: true`.
|
|
8559
8728
|
|
|
@@ -8588,6 +8757,8 @@ Task skills execute a specific action. Invoked via slash commands. `disable-mode
|
|
|
8588
8757
|
| **prd-to-issues** | `/prd-to-issues` | medium | Break PRD into GitHub issues with vertical slices and HITL/AFK tagging |
|
|
8589
8758
|
| **skill-audit** | `/skill-audit` | medium | Scan skills and agents for security risks: dangerous patterns, secrets, excessive permissions |
|
|
8590
8759
|
| **hipaa-validate** | `/hipaa-validate` | medium | Scan codebase for HIPAA compliance issues: PHI exposure, missing audit logging, unencrypted transmission/storage, access control gaps, temp file exposure, and missing BAA references |
|
|
8760
|
+
| **a11y-validate** | `/a11y-validate` | medium | Scan codebase for accessibility violations: WCAG 2.1 Level AA, EN 301 549, European Accessibility Act (EAA / EU 2019/882). Covers semantics, keyboard, focus, color contrast, forms, media, ARIA, motion, mobile (React Native + Flutter), and EAA accessibility-statement documentation. |
|
|
8761
|
+
| **seo-validate** | `/seo-validate` | medium | Scan codebase for SEO issues: W3C semantics, meta/OG tags, Schema.org, hreflang, Core Web Vitals (LCP/INP/CLS), resource hints, GEO, SPA/SSG/CSR crawlability, technical SEO, accessibility-for-SEO. Framework-aware (Next/Nuxt/Astro/Gatsby/SvelteKit/Remix/Angular/Vue/static HTML). |
|
|
8591
8762
|
|
|
8592
8763
|
## Hybrid Skills (31)
|
|
8593
8764
|
|
package/llms.txt
CHANGED
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
- [MCP Editor Compatibility](kb/reference/mcp-editor-compatibility.md)
|
|
45
45
|
- [MCP Server Templates](kb/reference/mcp-templates.md)
|
|
46
46
|
- [Merge-Friendly Install Model](kb/reference/merge-friendly-install-model.md)
|
|
47
|
+
- [AI Toolkit - opencode Compatibility](kb/reference/opencode-compatibility.md)
|
|
47
48
|
- [Plugin Pack Conventions](kb/reference/plugin-pack-conventions.md)
|
|
48
49
|
- [Quick Wins Implementation Summary](kb/reference/quick-wins-implementation-summary.md)
|
|
49
50
|
- [Skill Templates](kb/reference/skill-templates.md)
|
package/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.6.1",
|
|
3
3
|
"components": {
|
|
4
4
|
"agents": {
|
|
5
5
|
"description": "44 specialized agents (orchestrator, backend, frontend, security, devops, etc.)",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"tags": ["core", "agents"]
|
|
10
10
|
},
|
|
11
11
|
"skills": {
|
|
12
|
-
"description": "
|
|
12
|
+
"description": "94 skills (31 task + 31 hybrid + 32 knowledge)",
|
|
13
13
|
"path": "app/skills",
|
|
14
14
|
"target": ".claude/skills",
|
|
15
15
|
"type": "symlink",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"default": true
|
|
91
91
|
},
|
|
92
92
|
"skills": {
|
|
93
|
-
"description": "
|
|
93
|
+
"description": "94 skills (task, hybrid, knowledge)",
|
|
94
94
|
"default": true
|
|
95
95
|
},
|
|
96
96
|
"rules-common": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softspark/ai-toolkit",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Professional-grade AI coding toolkit:
|
|
3
|
+
"version": "2.6.1",
|
|
4
|
+
"description": "Professional-grade AI coding toolkit: 94 skills, 44 agents, multi-platform support (Claude, Cursor, Windsurf, Copilot, Gemini, Cline, Roo Code, Aider, Augment, Google Antigravity, Codex CLI, opencode), machine-enforced safety constitution, persona presets, skill security auditor, expanded lifecycle hooks, 11 plugin packs, and benchmark tooling.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"augment",
|
|
24
24
|
"antigravity",
|
|
25
25
|
"google-antigravity",
|
|
26
|
+
"opencode",
|
|
26
27
|
"multi-platform"
|
|
27
28
|
],
|
|
28
29
|
"homepage": "https://github.com/softspark/ai-toolkit",
|
|
@@ -56,7 +57,9 @@
|
|
|
56
57
|
"generate:roo": "python3 scripts/generate_roo_modes.py > .roomodes",
|
|
57
58
|
"generate:aider": "python3 scripts/generate_aider_conf.py > .aider.conf.yml",
|
|
58
59
|
"generate:codex-rules": "python3 scripts/generate_codex_rules.py .",
|
|
59
|
-
"generate:
|
|
60
|
+
"generate:opencode-agents": "python3 scripts/generate_opencode_agents.py .",
|
|
61
|
+
"generate:opencode-commands": "python3 scripts/generate_opencode_commands.py .",
|
|
62
|
+
"generate:all": "npm run generate:agents && npm run generate:codex-rules && npm run generate:opencode-agents && npm run generate:opencode-commands && npm run generate:cursor && npm run generate:windsurf && npm run generate:copilot && npm run generate:gemini && npm run generate:cline && npm run generate:roo && npm run generate:aider && npm run generate:llms"
|
|
60
63
|
},
|
|
61
64
|
"files": [
|
|
62
65
|
"bin/",
|
package/scripts/config_cli.py
CHANGED
|
@@ -96,17 +96,11 @@ def cmd_validate(args: list[str]) -> int:
|
|
|
96
96
|
print(f" ✗ Merge failed: {e}")
|
|
97
97
|
return 1
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
("constitution articles intact", True),
|
|
103
|
-
]
|
|
104
|
-
|
|
99
|
+
# Summary — these passed because validation above would have returned 1
|
|
100
|
+
print(f" ✓ schema valid")
|
|
101
|
+
print(f" ✓ no forbidden overrides")
|
|
105
102
|
if extends:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
for label, ok in checks:
|
|
109
|
-
print(f" {'✓' if ok else '✗'} {label}")
|
|
103
|
+
print(f" ✓ extends resolved")
|
|
110
104
|
|
|
111
105
|
print("\n Config valid ✓")
|
|
112
106
|
return 0
|
package/scripts/doctor.py
CHANGED
|
@@ -454,13 +454,13 @@ def check_stale_rules(dr: DiagResult, fix_mode: bool) -> None:
|
|
|
454
454
|
for rule_file in sorted(RULES_DIR.iterdir()):
|
|
455
455
|
# Check for stale symlinks
|
|
456
456
|
if rule_file.is_symlink() and not rule_file.exists():
|
|
457
|
-
|
|
457
|
+
dr.warn(f"Stale symlink: {rule_file}")
|
|
458
458
|
stale += 1
|
|
459
459
|
if fix_mode:
|
|
460
460
|
rule_file.unlink()
|
|
461
|
-
|
|
461
|
+
dr.fixed(f"removed stale symlink: {rule_file.name}")
|
|
462
462
|
elif rule_file.is_file() and rule_file.stat().st_size == 0:
|
|
463
|
-
|
|
463
|
+
dr.warn(f"Empty rule file: {rule_file}")
|
|
464
464
|
stale += 1
|
|
465
465
|
|
|
466
466
|
if stale == 0:
|