Build a new agent tool via a structured 12-phase dialogue (phases 0–11). Walks through requirements, challenges necessity, locks the routing contract, then generates implementation code adapted to your stack. Works with any language, any framework.
Create a new agent tool through a structured 12-phase dialogue. Each phase must complete before the next begins. Do not skip phases or collapse multiple phases into one response.
Ask open-ended questions to understand what the user wants the tool to do. Do not propose a name or schema yet. Listen for the core capability, the use case, and the data required. End with a clear problem statement that the tool will solve.
Challenge the tool's necessity before proceeding. Ask:
If the tool clearly overlaps with an existing one, say so and ask how it differs. Only proceed when the tool passes the skeptic gate.
Lock the routing contract — the description is what the LLM reads to decide when to call this tool. It must be unambiguous.
get_portfolio_value)Collect the tool's full specification:
| Field | What to ask |
|-------|-------------|
| schema | What parameters does the tool accept? (name, type, required/optional, description for each) |
| category | What category? (e.g. portfolio, account, market) |
| consequenceLevel | How serious is a wrong call? (low / medium / high) |
| requiresConfirmation | Should the HITL engine pause for user approval? (yes/no) |
| timeout | Max execution time in ms (default: 10000) |
| tags | Optional searchability tags |
| triggerPhrases | 3–5 example user phrases that should trigger this tool |
Collect the HTTP routing information:
| Field | What to ask |
|-------|-------------|
| endpointTarget | Full path template, e.g. /api/portfolio/{userId} |
| httpMethod | GET / POST / PUT / DELETE / PATCH |
| authType | How is the request authenticated? (bearer / api-key / none) |
| Parameter mapping | Which tool parameters map to path params vs. query params vs. body fields? |
Ask: "What does the tool context (ctx) need to provide at runtime?" For each dependency (API client, DB connection, auth token, external service), verify the user's sidecar context object already provides it. Flag any gaps.
Present a complete summary of the spec as a formatted block (name, description, schema, routing, HITL config, dependencies). Ask the user to confirm before any code is written. Do not proceed without explicit approval.
Generate the following files (show each in a separate code block, then write them):
tools/<name>.tool.js — ToolDefinition object with name, description, schema, category, consequenceLevel, requiresConfirmation, timeout, tags, triggerPhrases, mcpRouting, and a stub execute() for local testingtools/<name>.tool.test.js — Vitest unit tests covering: schema validation, happy path execute(), error path, timeout behaviortools/index.js (or create if absent)Run npm test (or vitest run) and confirm all tests pass. If any test fails, fix the generated code and re-run. Do not proceed until green.
Hand off to the /forge-eval skill: generate a golden eval suite (5–10 cases) and a labeled eval suite (2–3 multi-tool scenarios). Write to evals/<name>.golden.json and evals/<name>.labeled.json.
Hand off to the /forge-verifier skill: generate a verifier stub for the new tool's output. Write to verification/<name>.verifier.js and register in verification/index.js.
Print a summary of everything created:
Ask if the user wants to adjust anything before finishing.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer