Skip to content
Merged
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
89 changes: 87 additions & 2 deletions docs/features/experimental/custom-tools.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Define TypeScript/JavaScript tools that extend Roo's capabilities beyond built-in tools, enabling project-specific workflows and team standardization.
description: Define TypeScript/JavaScript tools that extend Roo's capabilities beyond built-in tools, with npm dependency support and per-tool environment variables.
keywords:
- experimental features
- custom tools
Expand All @@ -8,6 +8,8 @@ keywords:
- tool extension
- defineCustomTool
- workflow automation
- npm dependencies
- environment variables
image: /img/social-share.jpg
---
# Custom Tools
Expand Down Expand Up @@ -82,12 +84,95 @@ Tools from both directories are loaded. Tools with the same name in `.roo/tools/

---

## Using npm Dependencies

Custom tools can use npm packages. Install dependencies in the same folder as your tool, and imports will resolve normally.

```bash
# From your tool directory
cd .roo/tools/
npm init -y
npm install axios lodash
```

Then import in your tool:

```typescript
import { parametersSchema as z, defineCustomTool } from "@roo-code/types"
import axios from "axios"

export default defineCustomTool({
name: "fetch_api",
description: "Fetch data from an API endpoint",
parameters: z.object({
url: z.string().describe("API endpoint URL"),
}),
async execute({ url }) {
const response = await axios.get(url)
return JSON.stringify(response.data, null, 2)
}
})
```

---

## Per-Tool Environment Variables

Tools automatically load a `.env` file from the same folder. This lets you store API keys and secrets without hardcoding them.

**Setup:**

1. Create a `.env` file next to your tool:
```
.roo/tools/
├── my-tool.ts
├── .env # Loaded automatically
└── package.json
```

2. Add your secrets:
```bash
# .roo/tools/.env
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/XXX
API_SECRET=your-secret-key
```

3. Access them via `process.env`:
```typescript
import { parametersSchema as z, defineCustomTool } from "@roo-code/types"

export default defineCustomTool({
name: "notify_slack",
description: "Send a notification to Slack",
parameters: z.object({
message: z.string().describe("Message to send"),
}),
async execute({ message }) {
const webhookUrl = process.env.SLACK_WEBHOOK_URL
if (!webhookUrl) {
return "Error: SLACK_WEBHOOK_URL not set in .env"
}

const response = await fetch(webhookUrl, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: message }),
})

return response.ok ? "Message sent" : `Failed: ${response.status}`
}
})
```

**Security:** Ensure your `.env` file is ignored by version control to keep secrets safe.

---

## Limits

- **No approval prompts**: Tools are auto-approved when the feature is enabled—security trade-off for convenience
- **String-only results**: Tools must return strings (Roo's protocol constraint)
- **No interactive input**: Tools can't prompt the user mid-execution
- **No npm packages**: Tools are transpiled in isolation; use Node.js built-ins only
- **Cache invalidation**: Tool updates may require reloading the window

**vs. MCP:** [MCP](/features/mcp/overview) is for external services (search, APIs). Custom tools are for in-repo logic you control directly. MCP is more extensible; custom tools are lighter weight for project-specific actions.
20 changes: 20 additions & 0 deletions docs/features/slash-commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Please perform a thorough security review of the selected code:
**Frontmatter Fields:**
- **`description`**: Appears in the command menu to help users understand the command's purpose
- **`argument-hint`**: (Optional) Provides a hint about expected arguments when using the command. See [Argument Hints](#argument-hints) for detailed information
- **`mode`**: (Optional) Mode slug to switch to before running the command (e.g., `code`, `architect`). Roo switches to this mode first, then executes the command content in that mode's context

---

Expand Down Expand Up @@ -192,6 +193,25 @@ This will display as `/api-endpoint <endpoint-name> <http-method>` in the comman

## Examples and Use Cases

**Mode-Targeting Commands**

Use the `mode` field to ensure a command runs in a specific mode context:

```yaml
---
description: Analyze architecture and propose improvements
mode: architect
---

Review the current system architecture and suggest improvements for:
- Scalability bottlenecks
- Component coupling
- Security boundaries
- Data flow optimization
```

When you run this command, Roo switches to Architect mode first, then processes the command content with Architect's role definition and tool restrictions.

**Development Workflows**

**API Endpoint Generator**
Expand Down
6 changes: 0 additions & 6 deletions docs/providers/openrouter.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ For the complete, up-to-date model list with pricing and capabilities, see [Open

---

## Supported Transforms

OpenRouter provides an [optional "middle-out" message transform](https://openrouter.ai/docs/features/message-transforms) to help with prompts that exceed the maximum context size of a model. You can enable it by checking the "Compress prompts and message chains to the context size" box.

---

## Tips and Notes

* **Model Selection:** OpenRouter offers a wide range of models. Experiment to find the best one for your needs.
Expand Down
6 changes: 6 additions & 0 deletions docs/update-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ If you want to live on the edge and try things out before it's released, we have

---

### Version 3.38

* [3.38.0](/update-notes/v3.38.0) (2025-12-27)

---

### Version 3.37

* [3.37](/update-notes/v3.37) (2025-12-22)
Expand Down
37 changes: 37 additions & 0 deletions docs/update-notes/v3.38.0.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
description: Adds Agent Skills, improves slash command behavior, and streamlines providers and file reading.
keywords:
- roo code 3.38.0
- new features
- bug fixes
image: /img/v3.38.0/v3.38.0.png
---

# Roo Code 3.38.0 Release Notes (2025-12-27)

This release adds Agent Skills, improves slash command behavior, and streamlines providers and file reading.

<img src="/img/v3.38.0/v3.38.0.png" alt="Roo Code v3.38.0 Release" width="600" />

## Agent Skills

Roo now supports Agent Skills, which are portable skill folders containing instructions, scripts, and resources that the agent can discover and load on demand. This lets you package repeatable workflows and domain knowledge once and reuse them across projects to make results more consistent and reliable. ([#10335](https://github.com/RooCodeInc/Roo-Code/pull/10335)):

> **📚 Documentation**: See [Skills](/features/skills) for setup and usage.

## QOL Improvements

* Slash commands can declare a target mode in their front matter, so triggering a command can switch Roo to the right mode first ([#10344](https://github.com/RooCodeInc/Roo-Code/pull/10344)).
* Removes the legacy “simple read file” tool path so file reading consistently uses the standard `read_file` tool ([#10254](https://github.com/RooCodeInc/Roo-Code/pull/10254)).

## Bug Fixes

* Fixes an issue where some Claude Sonnet 4.5 requests could fail with HTTP 400 errors after context condensing ([#10359](https://github.com/RooCodeInc/Roo-Code/pull/10359)).

## Misc Improvements

* Custom tools can import npm packages, and can load secrets from a same-folder `.env` file ([#10336](https://github.com/RooCodeInc/Roo-Code/pull/10336)).

## Provider Updates

* Removes the “OpenRouter Transforms” setting and stops sending the `transforms` parameter on OpenRouter requests ([#10341](https://github.com/RooCodeInc/Roo-Code/pull/10341)).
7 changes: 7 additions & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ const sidebars: SidebarsConfig = {
label: 'Extension Release Notes',
items: [
'update-notes/index',
{
type: 'category',
label: '3.38',
items: [
{ type: 'doc', id: 'update-notes/v3.38.0', label: '3.38.0' },
],
},
{
type: 'category',
label: '3.37',
Expand Down
Binary file added static/img/v3.38.0/v3.38.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.