agentleFS
thecoderpandathecoderpanda/fde-starter-kit/skills/add-tool/SKILL.md

add-tool

Skill2 starsChanged 3 months agoMITView on GitHub

Scaffold a new agent tool with a typed Zod schema, a safe

  • Reads credentials

10 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask for these in one message, not one at a time:

    line 23
  2. Distinctive:

    Keep the object keys snake_case (that's what the model sees) and the identifiers camelCase (that's what TypeScript prefers).

    line 53
  3. Very specific:

    Update .env.example: if the tool needs a new env var.

    line 61
  4. Very specific:

    No silent truncation: If a response is truncated for size, return a field like truncated: true so the model knows.

    line 89
  5. Very specific:

    No unbounded loops: If the tool paginates, cap page count and return { nextPageToken, truncated: true } when hit.

    line 91

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “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

Purpose: keep every new tool consistent with the existing four — same shape, same safety rails, same test coverage — so tool sprawl doesn't turn the agent into an unpredictable mess.

When to fire

  • User says: "add a tool for X", "create a tool that calls Y", "the agent needs to be able to Z", "scaffold a tool".
  • User pastes an API spec and asks the agent to wrap it.

Inputs you need

Ask for these in one message, not one at a time:

  1. Tool name — snake_case, verb-first (e.g. send_email, not email_tool).
  2. One-line description — what the model sees when deciding whether to call it.
  3. Parameters — name, type, whether required, one-line description per param.
  4. Where the data comes from — HTTP call? Local file? Shell? DB?
  5. Failure modes — what returns an { error } object vs what throws.

Steps

  1. Create ./agent/tools/<name>.ts using the template in ./skills/add-tool/resources/template.ts. Fill in:
    • Zod schema mirroring the parameters spec.
    • execute body implementing the call.
    • Explicit early return with { error: "..." } for every failure mode identified in input 5. Never throw for expected failures — the agent handles error objects gracefully but a throw ends the turn.
  2. Register it in ./agent/tools/index.ts:
    import { <camelName>Tool } from "./<name>";
    export const tools = {
      ...,
      <name>: <camelName>Tool,
    } as const;
    Keep the object keys snake_case (that's what the model sees) and the identifiers camelCase (that's what TypeScript prefers).
  3. Add a smoke eval case to ./evals/cases/tools.jsonl. Every tool must have at least one case that asserts tool_called for its name, plus one negative case that ensures it does NOT get called for irrelevant queries. Copy the pattern from existing entries.
  4. Update .env.example if the tool needs a new env var. Add a comment explaining what happens when the var is missing (the tool should degrade gracefully — see web_search as reference).
  5. Type check + eval.
    npm run typecheck
    npm run eval
    Both must be green before you consider the tool done.

Definition of done

  • New file at ./agent/tools/<name>.ts matching the template shape.
  • Entry added to ./agent/tools/index.ts.
  • At least two new cases in ./evals/cases/tools.jsonl (positive + negative).
  • .env.example updated if applicable.
  • npm run typecheck passes.
  • npm run eval passes (or the user acknowledges an expected regression and approves).

Anti-patterns to avoid

  • No side-channel state. Tools must be pure functions of their inputs plus process env. No module-level mutable caches.
  • No any. The Zod schema is the contract; execute must be typed against z.infer<typeof schema>.
  • No silent truncation. If a response is truncated for size, return a field like truncated: true so the model knows.
  • No unbounded loops. If the tool paginates, cap page count and return { nextPageToken, truncated: true } when hit.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.