Skip to content

feat: native plugins for Cursor, Codex CLI, Kiro, and OpenCode - #77

Merged
antonbabenko merged 3 commits into
masterfrom
feat/multihost-native-plugins
Jun 1, 2026
Merged

antonbabenko merged 3 commits into
masterfrom
feat/multihost-native-plugins

Conversation

@antonbabenko

Copy link
Copy Markdown
Owner

What

Ship deliberation as a first-class native plugin per host (not just a raw MCP install) for four non-Claude hosts, so each matches the Claude Code plugin surface: persona-bearing experts + when-to-delegate guidance.

All host artifacts are generated from the canonical sources (prompts/*.md, AGENTS.md, rules/*.md, examples/*.md) by a new modular generator and committed, so they never drift.

Host Native artifacts Official channel
Cursor .cursor/rules/deliberation.mdc cursor.directory + one-click MCP deeplink
Codex CLI plugins/deliberation/ (.codex-plugin/plugin.json + .mcp.json + skills/) + .agents/plugins/marketplace.json codex plugin marketplace add antonbabenko/deliberation
Kiro POWER.md + mcp.json + steering/ "Add power from GitHub" + kiro.dev/powers/submit
OpenCode .opencode/commands/ + .opencode/agents/ opencode.json mcp + ecosystem listing

Engine

  • scripts/sync-hosts.js orchestrates per-host modules (scripts/hosts/{_shared,cursor,codex,kiro,opencode}.js). build(ctx) -> {path: content}, merged with a collision + path-traversal guard.
  • Deterministic, committed output; drift-guarded by test/host-artifacts.test.js + the validate workflow. version.json stays the single SSOT (pre-commit.js syncs the Codex manifest).
  • Zero new runtime deps; no build at git-load (same contract as scripts/sync-prompts.js).
  • Root .mcp.json freed + un-ignored to hold the project MCP config.

Verification

  • Host formats verified against live official docs (developers.openai.com/codex, kiro.dev/docs/powers, opencode.ai/docs, cursor.com/docs). Notable corrections caught during build: Codex rejects a root marketplace source.path (Marketplace local plugin path "./" cannot reference the repository root openai/codex#17066) -> plugin moved to a subdir + required interface fields added; OpenCode dirs are plural.
  • Generator reviewed by GPT + Gemini (deliberation's own code-reviewer, two rounds) -> caught + fixed: Codex subdir/interface, CRLF drift-stability, YAML frontmatter escaping, path-traversal guard, Kiro frontmatter quoting. Grok approved both rounds.

Test plan

  • node scripts/sync-hosts.js && node scripts/sync-hosts.js --check (drift-clean, 29 artifacts)
  • node --test test/*.test.js (282 pass)
  • npm run typecheck (clean)
  • Live smoke: codex plugin marketplace add antonbabenko/deliberation; Kiro "Add power from GitHub"; OpenCode install (cannot run in CI)

Follow-ups (tracked, not in this PR)

  • Kiro privacy-policy link in the POWER.md footer (gates manual kiro.dev/powers/submit only).
  • OpenCode .opencode/ frontmatter carries a harmless extra name: key.
  • Product bug found via dogfooding: ask-all's files attachment serializes as [object Object] for the OpenRouter delegate.

Generate first-class per-host plugin artifacts from the canonical sources
(prompts/*.md, AGENTS.md, rules/*.md, examples/*.md) via a new modular
generator, so each host matches the Claude Code plugin surface: persona-bearing
experts + when-to-delegate guidance, not just raw MCP tools.

Hosts:
- Cursor: .cursor/rules/deliberation.mdc
- Codex CLI: plugins/deliberation/ (.codex-plugin/plugin.json + .mcp.json +
  skills/) and a repo-scoped .agents/plugins/marketplace.json, installable with
  `codex plugin marketplace add antonbabenko/deliberation`. The plugin lives in
  a subdirectory because Codex rejects a root marketplace source.path
  (openai/codex#17066); interface carries the required
  displayName/developerName/category/capabilities.
- Kiro: POWER.md (keywords activation + license/support footer) + mcp.json +
  steering/ (a Kiro Power; "Add power from GitHub").
- OpenCode: .opencode/commands/ (thin MCP-tool wrappers) + .opencode/agents/
  (expert personas, mode: subagent). Dirs are plural per opencode.ai docs.

Engine: scripts/sync-hosts.js orchestrates per-host modules under
scripts/hosts/*.js; output is deterministic and committed, drift-guarded by
test/host-artifacts.test.js and the validate workflow. version.json stays the
single SSOT (pre-commit.js syncs the Codex manifest version). Zero new runtime
deps; no build at git-load. Root .mcp.json freed + un-ignored for the Codex
plugin config.

Host formats verified against live official docs; the generator was reviewed by
GPT + Gemini (deliberation's own code-reviewer) across two rounds, which caught
the Codex subdir/interface requirements, CRLF drift-stability, YAML frontmatter
escaping, and a path-traversal guard.
Two defects in the native host plugins (PR #77):

- Scrub Claude-Code-only references from generated non-Claude host artifacts.
  Kiro's steering/deliberation-triggers.md verbatim-copied rules/triggers.md,
  leaking ${CLAUDE_PLUGIN_ROOT}, a rules/orchestration.md path, and
  mcp__deliberation-* bridge tool names. Add a host-neutral transform in
  scripts/hosts/kiro.js (strips the Claude workflow block + the mcp__deliberation
  fenced examples, keeps the trigger tables) and an assertHostClean() guard in
  scripts/sync-hosts.js that fails generation if any host artifact leaks a
  Claude-only token (enforced for all four hosts + future ones). The source
  rules/*.md stay Claude-correct.

- Fix the OpenRouter delegate receiving file attachments as "[object Object]".
  core/providers/openai-compatible.js passed raw {path} file objects to
  buildInitialTurns (which expects already-inlined text), so buildMessages
  string-coerced them. Inline via the bridge's inlineFiles() (now exported from
  server/openrouter/index.js) before building turns, and surface skip notes like
  the standalone bridge. (Live effect requires an MCP server restart to reload.)

Reviewed by GPT + Gemini + Grok (deliberation's own code-reviewer, two rounds);
covered by tests OC5/OC6/OC7 + a no-Claude-token host artifact test.
286 tests + typecheck green; grep for Claude-only tokens in host artifacts empty.
docs/hosts/ is gitignored, so the per-host install instructions never shipped.
Move them to public-docs/hosts/ (tracked) and add the two missing hosts so all
four are covered: cursor.md, codex.md, kiro.md, opencode.md + an index README.
The repo README's "Native plugins per host" section links to them.

Reviewed by GPT + Gemini + Grok (/ask-all): aligned the OpenRouter credential
row across all four guides (declare models in ~/.config/deliberation/config.json)
and completed the Cursor tool/expert list to match the cross-host claim.
@antonbabenko
antonbabenko merged commit 52dd6fe into master Jun 1, 2026
1 check passed
@antonbabenko
antonbabenko deleted the feat/multihost-native-plugins branch June 1, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant