Skip to content

add tool-writer mode to marketplace#604

Merged
navedmerchant merged 6 commits into
Zoo-Code-Org:mainfrom
RayCarro:tool-writer
Jun 19, 2026
Merged

add tool-writer mode to marketplace#604
navedmerchant merged 6 commits into
Zoo-Code-Org:mainfrom
RayCarro:tool-writer

Conversation

@RayCarro

@RayCarro RayCarro commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #603

Description

Adds tool-writer mode to the marketplace. Writing tools is a bit finicky especially since the only way to test them is by asking Zoo to run its tool. This mode could have a dump of the documentation from https://github.com/Zoo-Code-Org/Zoo-Code-Docs/blob/main/docs/features/experimental/custom-tools.md and some additional examples.

Test Procedure

Pre-Submission Checklist

  • [ x ] Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • [ x ] Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • [ x ] Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • [ x ] Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

Does this PR necessitate updates to user-facing documentation?

  • [ x ] No documentation updates are required.
  • Yes, documentation updates are required. (Please describe what needs to be updated or link to a PR in the docs repository).

Summary by CodeRabbit

  • New Features

    • Added a “Tool Writer” marketplace mode to help users author and run custom tools.
  • Documentation

    • Added guidance for custom tool authoring (local/global install locations), schema/validation expectations, async string-only results, no interactive prompts, experimental auto-approval warning, and manual “Refresh Custom Tools”/reload after changes.
    • Documented how .env / .env.* files are handled per tool, plus included TypeScript/JavaScript implementation examples and a brief comparison to MCP.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 318a1700-da72-4787-9228-404b72c187a0

📥 Commits

Reviewing files that changed from the base of the PR and between cdcbbad and e756f62.

📒 Files selected for processing (1)
  • src/assets/marketplace/modes.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/assets/marketplace/modes.yml

📝 Walkthrough

Walkthrough

Adds a new marketplace mode tool-writer documenting how to author and load single-file TypeScript/JavaScript custom tools, including file locations, Zod validation/execute contract, .env handling, experimental auto-approval behavior, reload guidance, limits, and TypeScript examples.

Changes

Tool Writer Mode

Layer / File(s) Summary
tool-writer mode metadata
src/assets/marketplace/modes.yml
Introduces the tool-writer marketplace mode with slug, display name, description, author attribution, and permission groups restricting edits to .roo/tools/ tool sources and .env* configuration files.
Tool authoring instructions
src/assets/marketplace/modes.yml
Comprehensive customInstructions covering tool file structure and locations (.roo/tools/ workspace and ~/.roo/tools/ global), Zod schema validation with async execute returning strings, experimental auto-approval enablement and warning, operational constraints (no interactive prompts, string-only results), manual refresh requirements, npm dependency guidance, per-tool .env caching and runtime loading behavior, functional limits, and MCP comparison.
Implementation examples
src/assets/marketplace/modes.yml
TypeScript examples demonstrating tool patterns: exec helper using child_process.spawnSync with tail output trimming, structured messaging via context.task.say, and a minimal example showing context.task.condenseContext() usage within a tool.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🛠️ I nibble on docs beneath moonlight,
TypeScript carrots gleam so bright,
Zod seeds sown, tools tidy and neat,
No prompts—just strings for the greet,
Hop—refresh your tools, and code takes flight! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'add tool-writer mode to marketplace' clearly and specifically describes the main change: adding a new mode definition to the marketplace.
Description check ✅ Passed The PR description includes the required issue link (#603), describes what was added and why, but lacks explicit test procedure steps despite having that section header.
Linked Issues check ✅ Passed The PR successfully implements the requirements from issue #603: adds tool-writer mode to marketplace, surfaces custom-tools documentation, and includes implementation examples.
Out of Scope Changes check ✅ Passed All changes are in scope—the PR modifies only src/assets/marketplace/modes.yml to add the tool-writer mode as specified in issue #603.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/assets/marketplace/modes.yml (1)

4220-4221: ⚡ Quick win

Restrict edit scope to tool-authoring paths (least privilege).

For a tool-authoring mode, unrestricted edit is broader than needed. Narrowing edits to tool-related paths reduces accidental/destructive writes.

Suggested refactor
       groups:
         - read
-        - edit
+        - - edit
+          - fileRegex: (\.roo/tools/.*\.(ts|js|json)$|\.roo/tools/\.env(\..+)?$)
+            description: Tool source/config files under .roo/tools
         - command
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/assets/marketplace/modes.yml` around lines 4220 - 4221, The current mode
in modes.yml grants a broad "edit" scope (the literal token edit under the mode
whose entry shows "source: project"), which is too permissive for
tool-authoring; replace that single "edit" permission with a least-privilege set
of targeted edit path rules (e.g., restrict to globs like tools/**, tooling/**,
tool-config/** or the project's canonical tool-authoring paths) so only
tool-related files can be modified, updating the mode's permissions entry (the
place that currently contains "edit" and "source: project") to enumerate those
specific path patterns instead of the unrestricted "edit".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/assets/marketplace/modes.yml`:
- Around line 4218-4221: The marketplace mode grants the tool-writer only
read/edit permissions; add the missing command permission so the documented
workflows can run npm/test steps. Update the roles block for the tool-writer
entry (the groups: - read - edit stanza in modes.yml for the tool-writer mode)
to include command (e.g., groups: - read - edit - command) in the same entries
that describe the workflows, and ensure every occurrence that documents running
commands (the mode definitions that instruct npm/test) gets the same addition so
the mode can execute commands as intended.
- Around line 4214-4216: Update the mode description so the scope wording
consistently mentions both project and global tool locations instead of only
`.roo/tools`; change the `roleDefinition`/`whenToUse` text that currently
references `.roo/tools` alone to explicitly state both `.roo/tools` (project)
and `~/.roo/tools` (global) and clarify when to use each (e.g., local project
development vs. shared/global tools), ensuring the same phrasing is used
wherever the mode documents tool locations to avoid conflicting guidance.

---

Nitpick comments:
In `@src/assets/marketplace/modes.yml`:
- Around line 4220-4221: The current mode in modes.yml grants a broad "edit"
scope (the literal token edit under the mode whose entry shows "source:
project"), which is too permissive for tool-authoring; replace that single
"edit" permission with a least-privilege set of targeted edit path rules (e.g.,
restrict to globs like tools/**, tooling/**, tool-config/** or the project's
canonical tool-authoring paths) so only tool-related files can be modified,
updating the mode's permissions entry (the place that currently contains "edit"
and "source: project") to enumerate those specific path patterns instead of the
unrestricted "edit".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd745a15-63cc-47b0-8ec7-fcc24cba6399

📥 Commits

Reviewing files that changed from the base of the PR and between 6bcd398 and 2ff9271.

📒 Files selected for processing (1)
  • src/assets/marketplace/modes.yml

Comment thread src/assets/marketplace/modes.yml Outdated
Comment thread src/assets/marketplace/modes.yml
@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

taltas
taltas previously requested changes Jun 14, 2026

@taltas taltas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion

Comment thread src/assets/marketplace/modes.yml Outdated
@github-actions github-actions Bot added the awaiting-author PR is waiting for the author to address requested changes label Jun 15, 2026
@RayCarro RayCarro requested a review from taltas June 15, 2026 18:20
@github-actions github-actions Bot added awaiting-review PR changes are ready and waiting for maintainer re-review and removed awaiting-author PR is waiting for the author to address requested changes labels Jun 15, 2026
@navedmerchant navedmerchant dismissed taltas’s stale review June 19, 2026 02:25

Requested changes made

@navedmerchant navedmerchant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, merging

@navedmerchant navedmerchant added this pull request to the merge queue Jun 19, 2026
Merged via the queue into Zoo-Code-Org:main with commit f792c1b Jun 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tool-writer mode

3 participants