Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/guide/getting-started/supported-agents.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Supported Agents
description: How to integrate RTK with Claude Code, Cursor, Copilot, Cline, Windsurf, Codex, OpenCode, Hermes, Kilo Code, and Antigravity
description: How to integrate RTK with Claude Code, Cursor, Copilot, Cline, Windsurf, Codex, Jcode, OpenCode, Hermes, Kilo Code, and Antigravity
sidebar:
order: 3
---
Expand Down Expand Up @@ -42,6 +42,7 @@ Agent runs "cargo test"
| Codex CLI | AGENTS.md instructions | N/A |
| Kilo Code | Rules file (prompt-level) | N/A |
| Google Antigravity | Rules file (prompt-level) | N/A |
| Jcode | Prompt overlay (prompt-level) | N/A |
| Mistral Vibe | Planned ([#800](https://github.com/rtk-ai/rtk/issues/800)) | Pending upstream |

## Installation by agent
Expand Down Expand Up @@ -161,6 +162,15 @@ rtk init --agent antigravity # creates .agents/rules/antigravity-rtk-rules.md

Antigravity reads `.agents/rules/` as custom instructions. RTK adds guidance telling Antigravity to prefer `rtk <cmd>` over raw commands.

### Jcode

```bash
rtk init --agent jcode # creates .jcode/prompt-overlay.md in current project
rtk init -g --agent jcode # creates $JCODE_HOME/prompt-overlay.md or ~/.jcode/prompt-overlay.md
```

Jcode reads `prompt-overlay.md` as custom instructions. RTK adds guidance telling Jcode to prefer `rtk <cmd>` when using its `bash` / `shell_exec` tool. This is prompt-level guidance until Jcode exposes a before-tool hook that can mutate `command`.

### Mistral Vibe (planned)

Support is blocked on upstream `BeforeToolCallback` ([mistral-vibe#531](https://github.com/mistralai/mistral-vibe/issues/531)). Tracked in [#800](https://github.com/rtk-ai/rtk/issues/800).
Expand All @@ -173,7 +183,7 @@ Support is blocked on upstream `BeforeToolCallback` ([mistral-vibe#531](https://
| **Plugin** | TypeScript, JavaScript, or Python in agent's plugin system | Transparent, in-place mutation when the agent allows it |
| **Rules file** | Prompt-level instructions | Guidance only — agent is told to prefer `rtk <cmd>` |

Rules file integrations (Cline, Windsurf, Codex, Kilo Code, Antigravity) rely on the model following instructions. Full hook integrations (Claude Code, Cursor, Gemini) are guaranteed — the command is rewritten before the agent sees it. Plugin integrations (OpenCode, Pi) use in-place mutation via the agent's TypeScript extension API.
Rules file integrations (Cline, Windsurf, Codex, Kilo Code, Antigravity, Jcode) rely on the model following instructions. Full hook integrations (Claude Code, Cursor, Gemini) are guaranteed — the command is rewritten before the agent sees it. Plugin integrations (OpenCode, Pi) use in-place mutation via the agent's TypeScript extension API.

## Windows support

Expand Down
4 changes: 3 additions & 1 deletion hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Deployed hook artifacts** — the actual files installed on user machines by `rtk init`. These are shell scripts, TypeScript plugins, and rules files that run outside the Rust binary. They are **thin delegates**: parse agent-specific JSON, call `rtk rewrite` as a subprocess, format agent-specific response. Zero filtering logic lives here.

Owns: per-agent hook scripts and configuration files for 9 supported agents (Claude Code, Copilot, Cursor, Cline, Windsurf, Codex, OpenCode, Hermes, Pi).
Owns: per-agent hook scripts and configuration files for 10 supported agents (Claude Code, Copilot, Cursor, Cline, Windsurf, Codex, OpenCode, Hermes, Pi, Jcode).

Does **not** own: hook installation/uninstallation (that's `src/hooks/init.rs`), the rewrite pattern registry (that's `discover/registry`), or integrity verification (that's `src/hooks/integrity.rs`).

Expand Down Expand Up @@ -42,6 +42,7 @@ Each agent subdirectory has its own README with hook-specific details:
- **[`opencode/`](opencode/README.md)** — TypeScript plugin, `zx` library, `tool.execute.before` event, in-place mutation
- **[`pi/`](pi/README.md)** — TypeScript extension, `tool_call` event, `isToolCallEventType` guard, in-place mutation, `~/.pi/agent/extensions/`
- **[`hermes/`](hermes/README.md)** — Python plugin, `pre_tool_call` hook, in-place terminal command mutation
- **[`jcode/`](jcode/README.md)** — Prompt overlay, `.jcode/prompt-overlay.md` project-local or `$JCODE_HOME/prompt-overlay.md` global

## Supported Agents

Expand All @@ -58,6 +59,7 @@ Each agent subdirectory has its own README with hook-specific details:
| OpenCode | TypeScript plugin (`tool.execute.before`) | In-place mutation | Yes |
| Pi | TypeScript extension (`tool_call` event) | In-place mutation | Yes |
| Hermes | Python plugin (`pre_tool_call`) | In-place mutation | Yes |
| Jcode | Prompt overlay (`prompt-overlay.md`) | Prompt-level guidance | N/A |

## JSON Formats by Agent

Expand Down
45 changes: 45 additions & 0 deletions hooks/jcode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# RTK for Jcode

Jcode currently supports prompt-level RTK integration through `prompt-overlay.md`.

## Installation

Project-scoped:

```bash
rtk init --agent jcode
```

Creates or updates:

```text
.jcode/prompt-overlay.md
```

Global:

```bash
rtk init -g --agent jcode
```

Creates or updates:

```text
$JCODE_HOME/prompt-overlay.md
```

If `JCODE_HOME` is unset, RTK uses:

```text
~/.jcode/prompt-overlay.md
```

## How it works

Jcode reads prompt overlay files and incorporates them into the agent instructions. RTK adds a marked instruction block telling Jcode to prefer `rtk <command>` when using its `bash` or `shell_exec` tool.

This is a prompt-level integration. It does not transparently rewrite commands before execution because current Jcode builds do not expose a before-tool hook with `updated_input.command` support.

## Future transparent rewrite support

If Jcode adds a `BeforeToolCall` hook that can mutate the `command` field, RTK can add `rtk hook jcode` and upgrade this integration to transparent command rewriting.
23 changes: 23 additions & 0 deletions hooks/jcode/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- rtk-instructions jcode v1 -->
# RTK command usage for Jcode

When using Jcode's `bash` or `shell_exec` tool, prefer RTK-wrapped commands for supported developer workflows. RTK filters noisy command output before it reaches the model context.

Use RTK for common commands such as:

- `rtk git status` instead of `git status`
- `rtk git diff` instead of `git diff`
- `rtk git log` instead of `git log`
- `rtk cargo test` instead of `cargo test`
- `rtk cargo build` instead of `cargo build`
- `rtk npm install` instead of `npm install`
- `rtk pytest` instead of `pytest`
- `rtk grep <pattern> <path>` instead of raw `grep` when compact output is acceptable

Rules:

- If a command already starts with `rtk`, do not add another `rtk`.
- Use raw commands only when RTK is unavailable, unsuitable, or exact raw output is required.
- For chained commands, prefix each supported command separately when practical, for example `rtk cargo fmt && rtk cargo test`.
- RTK is safe for unsupported commands because it passes through when no filter applies.
<!-- /rtk-instructions -->
9 changes: 9 additions & 0 deletions integration-docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Integration Analysis Documents

This directory stores exploratory integration analysis and design notes for agent support work.

These files are intentionally kept outside RTK's product documentation under `docs/` so experimental or implementation-planning material does not pollute user-facing docs.

## Current analyses

- [`jcode/agent-requirements.zh.md`](jcode/agent-requirements.zh.md) — Jcode capabilities and RTK integration requirements.
Loading