Skip to content

add tool-writer mode to marketplace#604

Open
RayCarro wants to merge 3 commits into
Zoo-Code-Org:mainfrom
RayCarro:tool-writer
Open

add tool-writer mode to marketplace#604
RayCarro wants to merge 3 commits into
Zoo-Code-Org:mainfrom
RayCarro:tool-writer

Conversation

@RayCarro

@RayCarro RayCarro commented Jun 13, 2026

Copy link
Copy Markdown

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 add and run custom tools.
  • Documentation

    • Guide for building/installing custom tools (local or global), validation/schema and expected string output, no interactive prompts, experimental auto-approval warning, manual refresh required after updates, guidance for per-tool environment file handling, and TypeScript/JS examples.

@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: 759e3736-f225-44c9-b903-9e963e26b537

📥 Commits

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

📒 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 definition and documentation
src/assets/marketplace/modes.yml
Adds a tool-writer marketplace mode entry with full customInstructions: tool file locations and override rules, experimental enablement and auto-approval warning, tool contract (Zod schema + execute returns string), prohibition of interactive input, manual refresh guidance, per-tool .env caching/loading instructions, limits and MCP comparison, and embedded TypeScript examples demonstrating CustomToolContext and context.task.condenseContext().

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' is concise and clearly describes the main change - adding a new marketplace mode.
Description check ✅ Passed The PR description follows the required template structure with linked issue, description, and pre-submission checklist mostly completed, though test procedure lacks explicit steps.
Linked Issues check ✅ Passed The code changes fully implement the requirements from issue #603: adds tool-writer mode to marketplace with documentation content and examples for custom tool authoring.
Out of Scope Changes check ✅ Passed All changes are focused solely on adding the tool-writer mode definition to modes.yml, directly addressing the linked issue requirements with no out-of-scope modifications.
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!

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.

tool-writer mode

1 participant