agentleFS
sakurablushsakurablush/zeroagent-studio/.cursor/skills/add-browser-tool/SKILL.md

add-browser-tool

Skill4 starsChanged 4 months agoMITView on GitHub

Add a browser-native or cloud tool to ZeroAgent Studio. Use for file, network, speech, provider APIs, custom script capabilities, or manifest presets.

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add a preset handler in the matching src/tools/engines/<engine>Runner.ts if needed

    line 27
  2. Very specific:

    Add a row to MANIFEST_TOOLS in src/tools/manifests/index.ts:

    line 28
  3. Very specific:

    Add engine fixture tests in tests/tools/engines/allRunners.test.ts

    line 36
  4. Very specific:

    Do not: add a switch in dag.ts or hardcode tools in NodePalette.tsx — the registry drives palette, icons, inspector labels, and execution.

    line 57
  5. Very specific:

    No backend — client-only APIs (fetch, File System Access, Web Speech, Web Worker for custom script)

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add Tool (registry)

Choose a path

PathWhenFiles
Manifest presetSimple text/JSON transform, no UI, no side effectsOne row in src/tools/manifests/index.ts + engine preset in src/tools/engines/*Runner.ts
Curated moduleFile picker, mic, fetch, cloud API, custom inspectorsrc/tools/<tool>.ts + entry in CURATED_TOOLS inside src/tools/registry.ts

Most new utilities should be manifest presets — the palette has 180+ manifest entries backed by shared runner engines (stringRunner, encodingRunner, hashRunner, jsonRunner, listRunner, mathRunner, dateRunner, validateRunner, flowRunner, regexRunner, generateRunner, htmlRunner, markdownRunner, csvRunner, compareRunner). Use getSiteStats() for live counts — do not hardcode.

Manifest preset (preferred for transforms)

  1. Add a preset handler in the matching src/tools/engines/<engine>Runner.ts if needed
  2. Add a row to MANIFEST_TOOLS in src/tools/manifests/index.ts:
textTool('my-tool-id', 'My Tool', 'Description', '🔧', 'string', 'trim', 'text')
// or custom entry with JSON_IN / JSON_OUT for json engine
  1. Registry auto-merges manifests via manifestToToolDefinitions() — no manual TOOL_REGISTRY push
  2. Add engine fixture tests in tests/tools/engines/allRunners.test.ts
  3. catalog.test.ts enforces ≥100 tools, unique ids, and port defs

Manifest tools get default inputs/outputs (text → text or json → text). Inspector shows description + port legend + Test button only.

Curated module (file / network / cloud / sandbox)

  1. src/tools/<tool>.ts — implement run with typed ports:
run: async (inputs, config, ctx) => {
  const input = getPrimaryInput(inputs)
  const result = await doWork(input, config, ctx)
  return singleTextOutput(result)
}
  1. src/tools/registry.ts — add one entry to CURATED_TOOLS with inputs, outputs, paletteGroup, browserSubcategory: 'curated', requirement, run (or wrapLegacyRun during migration)
  2. src/components/inspector/ToolInspectorFields.tsx — config fields + optional Test button
  3. tests/tools/<tool>.test.ts — permissions denied, empty input, network/API errors

Do not add a switch in dag.ts or hardcode tools in NodePalette.tsx — the registry drives palette, icons, inspector labels, and execution.

Registry entry checklist

  • id: kebab-case (e.g. text-transform) — becomes ToolType
  • inputs / outputs: PortDef[] from src/lib/ports.ts (TEXT_IN, TEXT_OUT, JSON_IN, …)
  • paletteDragType: tool-<id> (e.g. tool-text-transform)
  • getPaletteTutorialTarget(dragType) — add palette-<id> target (legacy aliases kept for quests)
  • paletteGroup: browser | cloud | custom
  • browserSubcategory: for browser tools — curated | text | encoding | json | list | math | date | validate | flow
  • requirement:
    • { kind: 'none' } — always available
    • { kind: 'browser', feature: 'speechRecognition' | 'speechSynthesis' | 'clipboard' }
    • { kind: 'apiKey', provider: 'groq' | 'gemini' | 'openrouter' }
  • run: (inputs: Record<string, PortValue>, config, ctx) => Promise<Record<string, PortValue>>

Ports & connections

  • Chat: output message (text only)
  • Agent: input context (text, multiple edges OK), output out
  • Tools: from registry inputs / outputs
  • canConnect() in src/lib/ports.ts — json→text OK; text→json blocked at connect time
  • Edges persist sourceHandle / targetHandle; legacy workflows migrate on load (src/lib/workflowMigration.ts)

Constraints

  • No backend — client-only APIs (fetch, File System Access, Web Speech, Web Worker for custom script)
  • Permissions: mic/file/clipboard only on explicit run; graceful cancel messages
  • Scraper: text extraction; never inject raw HTML into React DOM
  • Custom script: Web Worker sandbox, no network in v1, 8 KB / 8 s limits
  • Log via ctx.log → orchestrator → debugStore (Activity log)

Validate

npm run ci

Manual: wire tool node → agent → chat; run on canvas.

Docs sync (user-facing changes):

Change typeUpdate
New tool / portsGuidePage.tsx Tools section if notable; README.md tool table if essential
Quest step / tooltutorialQuests.ts, tutorialValidators.ts, Guide quests section, README quest table
Port rulesGuide wiring section, README typed ports, this skill

Rules: .cursor/rules/zeroagent-engineer.mdc · .cursor/rules/zeroagent-test-engineer.mdc

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.